New DLL features

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.

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
You can now add strings containing just English.

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 &#26085;&#26412;&#35486; as default and finding &#33521;&#35486; in the list was a less fun task than I would like. Well finding &#33521;&#35486; was the easy part. Figuring out that &#33521;&#35486; 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.
 
Will these scripts need to know about new Text files added.
Presumably not. I figure it will end up going though all files in Assets\XML\TEXT. I have no plans for how such a script should work and I don't plan on starting to work on it now.

But do remember that it is in master only, not the branches. You still have to add all languages to the branches ;)

Come to think of it, do you? What if you use English and only add English. You will need all languages BEFORE the current one, but when I think about vanilla code I think it will skip all languages after the one you use. You could always try not to add more than just English and see what happens.
 
Back
Top Bottom