isau
Deity
- Joined
- Jan 15, 2007
- Messages
- 3,071
Hey guys,
A player recently provided a Russian translation of my Combined Tweaks mod. I'd like to be able to implement it. It's pretty easy to update my existing code in most places. For example, this:
Becomes this:
The original idea was that the English translation would run first, and apply to every language. Then Russian would run and overwrite it. But the trouble is, many of my mod's additions are concat strings, not overwrites. It's this way in case the player installed some other mod that also changed the underlying game, in hopes the concat correctly describes the change.
Right now in Russian, what you get is [base text] [modded English text] [modded Russian text]
There are a couple of ways I can fix this:
A player recently provided a Russian translation of my Combined Tweaks mod. I'd like to be able to implement it. It's pretty easy to update my existing code in most places. For example, this:
Code:
UPDATE LocalizedText SET Text= Text || ' [ICON_CAPITAL] (Quo Mod: Cities receive +1 [ICON_PRODUCTION] Production for every district, starting with the fourth district built.)'
WHERE Tag='LOC_TRAIT_CIVILIZATION_IMPERIAL_FREE_CITIES_DESCRIPTION' ;
Becomes this:
Code:
UPDATE LocalizedText SET Text= Text || ' Город с четырьмя специализированными районами получает +1 к [ICON_PRODUCTION] производству в каждом из них.'
WHERE Tag='LOC_TRAIT_CIVILIZATION_IMPERIAL_FREE_CITIES_DESCRIPTION' AND Language='ru_RU';
The original idea was that the English translation would run first, and apply to every language. Then Russian would run and overwrite it. But the trouble is, many of my mod's additions are concat strings, not overwrites. It's this way in case the player installed some other mod that also changed the underlying game, in hopes the concat correctly describes the change.
Right now in Russian, what you get is [base text] [modded English text] [modded Russian text]
There are a couple of ways I can fix this:
- Create a file for every single language and have the text simply be English. But it's very unlikely I'll really get translations for all 12 languages Civ 6 supports, and this is a LOT of files.
- Add to the English translation some kind of check to see if the language has a translated version and only write to languages that do not. This is fine until new translations come in and then I've got to update all of them. I guess a simple find/replace could this. It seems like the best option.
- Somehow write a table system that checks to see if an English translation was concated to a string, revert the string for Russian and then concat it.