Elistear wrote:Is there an efficient way to synchronize the string table I'm currently working on (let's call it zh-cn.txt) with the latest one? What I can think of is to find each different item between two en.txt and then insert/modify it in zh-cn.txt. But omitting is very likely to happen if doing in this way. Any suggestion?
Hi Elistear!
Here's how I do to keep the FR file synchronized with the latest EN file. It's a fully-manual process, so it needs to be done neatly, but despite this, it's the easiest way to update your file without being lost.
*************
What you need:
*************
- A visual diff program called
Meld (
http://meldmerge.org/ ; Meld for Windows here >
http://sourceforge.net/projects/meld-installer/)
- Notepad 2 or Notepad++... well, any text editor which displays line numbers and which can wrap lines(CTRL+W)
- some GitHub favorites:
* Commit history of en.txt >
https://github.com/freeorion/freeorion/ ... les/en.txt
* Latest en.txt (raw) >
https://raw.githubusercontent.com/freeo ... les/en.txt
- 3 files:
* your zh-cn.txt
* your local en.txt file which with your zh-cn.txt is synchronized
* the latest en.txt (found on Github)
****************
Synchronize your file
****************
- Download the latest en.txt on GitHub ("save as" with your navigator). As I write this message, its date is May 11th, 2015. So name it en_05112015.txt (edit: or
en_20150511.txt -YYYY-MM-DD- like github format).
- With Meld, compare your local en.txt with the latest en.txt. On this screen, you can see the difference between en_05102015.txt (which with my Fr file is synchronized) and en_05112015.txt:
- diff_1.PNG (10.71 KiB) Viewed 8582 times
As you see, on line 3645, a full sentence has been replaced by a Key.
With your text editor (Notepad 2 or Notepad ++), open your zh-cn.txt and go to line 3645 (CTRL+G). Here's the example with my FR file:
- text_editor.png (7.59 KiB) Viewed 7497 times
Do the same for each differences that Meld finds (line additions, line modifications, line deletions) . For my part, I translate directly each new modified or added values, so it's done.
Once it's finished, the simplest way to check if you forgot nothing is just to check if the number of lines are equal between the latest en.txt and your zh-cn.txt. ^^
Easy!
*****
Notes
*****
- Check the en.txt commit history regularly (I do it once a week). Compare the date of your local en.txt file and the date of the last commit on GitHub, to see if there's something new.
- As you started the chinese translation from scratch, you avoid the obsolete values in the already translated strings. I see you used the en.txt from April 26th, 2015, so it's good. You can download it again here (
https://raw.githubusercontent.com/freeo ... les/en.txt) and compare it with the latest en.txt.
Then, check if each new difference are also on your zh-cn.txt.
EDIT: oops, I see you used the en.txt of the stable release as reference, which is pretty out of date. So you can't avoid it. You have to compare the en.txt of the stable release with the latest en.txt on GitHub... and manually check and merge each difference (and there's a lot) on your zh-cn.txt.
- I think it's better to translate side-by-side, i.e. to always have the latest en.txt opened in another window. Here's an example with the FR file:
- side_by_side.png (22.54 KiB) Viewed 7497 times
As the number of lines is matched, it's easy to navigate, to compare, to check the original english lines, etc. and in the case of the FR translation, it prevents the obsolete values in the already translated strings (I do not translate directly from the untranslated lines in the FR file, and I can check all the lines already translated by a previous translator... a long time ago, so it has great chances to contain obsolete values). Hopefully, don't bother you with that as you're the first chinese translator.
- A quick way to see if you haven't mess with a key or values syntax (or forgot a triple quote) is to launch FO with your latest zh-cn translated file (start or load a game, not just the title screen). Close FO and then open the freeorion log (in Users/Roaming/Freeorion on Windows). If anything went wrong, it will be listed at the beginning of the file.
- I don't know how you translate, but for my part, I translate directly in-game, i.e. I modify my FR file directly in the Stringtables folder while the game is launched, and I used the "Flush Stringtables" button in the Options to check the result in-game.
Useful to check if the translation fits the UI, or iif it matches with the game context.
**************
That's all!
I think I forgot nothing!
Good luck!