Nightinggale
Deity
- Joined
- Feb 2, 2009
- Messages
- 5,378
Seeing that we have no general place to announce DLL changes, I decided to make a thread just for that. This thread is for announcing NEW features in the DLL.
In fact we can remove all other languages and re-add them if somebody decides to start translating as they are pretty broken by now.
We likely should delete all non-English strings, which happen to be identical to English. Maybe I will write a script for that task.
Another script to add a new language could also be useful. Say that somebody wants to translate to German (after we deleted all English in German), we run a script to add <German></German> to all text not containing German. The translator will then have something useful to search for. The game will automatically use English for empty/untranslated strings meaning adding new "English only" strings will not break the game when using translations (though it will show an English string).
I changed languages to always use the English name when selecting language. This be because I once ended up with 日本語 as default and finding 英語 in the list was a less fun task than I would like. Well finding 英語 was the easy part. Figuring out that 英語 was the right one in the list wasn't.
For the record: this is pushed to the master branch.
EDIT: forgot to mention that I wanted to use code from C2C to implement this. However since C2C relies heavily on apache for this feature I had to code everything from scratch. Also I didn't hardcode anything in the DLL and only use XML for setup.
Including investigation, failed attempt with C2C code and testing, I ended up using around a week on this, way more than expected. I still think it was worth it as it gives us great freedom when adding text from now on.
You can now add strings containing just English.git log said:Rewrite of translation handling
-New languages can be added using XML only
-TEXT XML files can have translations for any number of languages
-English is used when strings aren't present for current language
-TEXT strings can be added with English as the only language
-Empty strings are ignored (same as not present)
-TEXT strings no longer cares for order of languages
-Selected language is stored in ISO 639-2 code to avoid depending on language index
Details on adding new languages can be read in comments in newly added XML\GameInfo\CIV4LanguageInfos.xml
In fact we can remove all other languages and re-add them if somebody decides to start translating as they are pretty broken by now.
We likely should delete all non-English strings, which happen to be identical to English. Maybe I will write a script for that task.
Another script to add a new language could also be useful. Say that somebody wants to translate to German (after we deleted all English in German), we run a script to add <German></German> to all text not containing German. The translator will then have something useful to search for. The game will automatically use English for empty/untranslated strings meaning adding new "English only" strings will not break the game when using translations (though it will show an English string).
I changed languages to always use the English name when selecting language. This be because I once ended up with 日本語 as default and finding 英語 in the list was a less fun task than I would like. Well finding 英語 was the easy part. Figuring out that 英語 was the right one in the list wasn't.
For the record: this is pushed to the master branch.
EDIT: forgot to mention that I wanted to use code from C2C to implement this. However since C2C relies heavily on apache for this feature I had to code everything from scratch. Also I didn't hardcode anything in the DLL and only use XML for setup.
Including investigation, failed attempt with C2C code and testing, I ended up using around a week on this, way more than expected. I still think it was worth it as it gives us great freedom when adding text from now on.