Mod localisation

Users who are viewing this thread

Kommissar

Recruit
Hello,

I'd like to add proper localisation to my mod. To do this, I looked at how the ModuleData stuff is handled. I created a global_strings.xml with just one reference.

Code:
<?xml version="1.0" encoding="utf-8"?>
<base xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" type="string">
  <strings>
    <string id="str_TownDescription" text="{=rev01}The people of {SETTLEMENT} seem to be content" />
  </strings>
</base>
I also created two files in ModuleData\Languages. One is nested under TR folder (Turkish). Both are called std_global_strings_xml.xml.

Contents of The English file:
XML:
<?xml version="1.0" encoding="utf-8"?>
<base xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" type="string">
  <tags>
    <tag language="English" />
  </tags>
  <strings>
    <string id="rev01" text="bla bla {SETTLEMENT} seem to be content" />
  </strings>
</base>

Contents of the Turkish file:
XML:
<?xml version="1.0" encoding="utf-8"?>
<base xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" type="string">
  <tags>
    <tag language="Türkçe" />
  </tags>
  <strings>
    <string id="rev01" text="Basit Spata  {SETTLEMENT} Basit Spata " />
  </strings>
</base>

Now. Here is the weird part.
When I load the game in English, text from the regular global_strings.xml is loaded. When I load the game in TURKISH, I get the output from the ENGLISH file. How do I fix this? I display the text in the following way:
C#:
TextObject textObject = new TextObject("{=rev01}The people of {SETTLEMENT} seem to be content", null);
textObject.SetTextVariable("SETTLEMENT", this._settlementInfo.Settlement.Name);

return textObject.ToString();

If anyone knows what's up that would be great :smile:
 
Back
Top Bottom