Cities: Skylines

Cities: Skylines

Not enough ratings
CSLTranslationComparisonTable
   
Award
Favorite
Favorited
Unfavorite
Mod
File Size
Posted
Updated
115.472 KB
13 Apr, 2020 @ 8:01pm
2 Jun, 2023 @ 11:31am
5 Change Notes ( view )

Subscribe to download
CSLTranslationComparisonTable

Description
CSLTranslationComparisonTable

Objective
  • To create a list to find LocaleIDs for predefined in-game languages.
  • Change in-game text.

Target person
  • It is for mod creators who support word-level multilingualization within the range that exists in the game.
  • Those who want to change the in-game text

Features
  • 1: Create a comparison table (HTML or XML) of English and selected locale files' translated text in the same locale key.
  • 2: Create a locale file from an XML file.

How to use
  • 1: Go to the main menu -> Content Manager -> MOD and press the option button for CSLTranslationComparisonTable.

[To create a comparison table]
  • 2-1: Select the locale file to be compared from the pull-down menu.
  • 2-2: Press the create html or xml button.
  • 2-3:Hopefully, the CSLTranslationComparisonTable.html or CSLTranslationComparisonTable.xml file will be saved in the same directory as Cities.exe.(In other words, the folder where Cities: Skylines is installed.)
    Also, if you generate an html file, hopefully the browser will open automatically.

[Create locale file]
  • 3-1: Save the XML file in the same directory as Cities.exe in the same format as the XML file created in 2-3, named CSLTranslationComparisonTable.xml.
  • 3-2: By clicking the convert button, CSLTranslationComparisonTable.xml file in the same directory as Cities.exe will be read and saved as CSLTranslationComparisonTable.locale in the same directory as Cities.exe.
  • 3-3: Copy the created locale file to the Files/Locale directory, and change the language in the game options. It's okay to rename the file to an appropriate name.

  • 4: The progress and results will be displayed. If an exception occurs, it will also be recorded in output_log.txt for your troubleshooting.

XML file format:
TextPairs/targetEnglishName:
English name of the translation data
TextPairs/targetNativeName:
The native name of the translation data.
TextPairs/targetSteamAppID:
zero
TextPairs/textPairs/TextPair:
Attribute: ID,KEY,INDEX of Locale.Key
TextPairs/textPairs/TextPair/english:
English that can be retrieved by keying attributes in Locale.Get()
TextPairs/textPairs/TextPair/target:
A string in the selected locale that can be retrieved by keying the attribute with TextPairs/textPairs/TextPair/target: Locale.Get().
Also, a string to be stored when the locale file is created.

Source file
The source file is in the same directory as the mod.

Limitations
  • I use Mono's XmlSerializer to read and write XML, but don't ask because I don't know the detailed specs and there's a good chance I won't know if something goes wrong.
  • I'm well aware that there are many better programs to read and write locale files, so please don't try to teach me.
    This is because I created this program in 2015 as an auxiliary tool for creating CSLMoreGraphs, and I still use it today.
  • The html file tries to download jQuery and tablesorter from google and cloudflare cdn.
  • The ID and KEY columns may be narrowed when converted to HTML files.
  • If the locale file name is not ISO639-1, an exception will be raised which states that the legal document has failed to load.

Credits

Tips.
  1. There are some characters in XML string data that require some escaping.
    original
    escaped
    "
    "
    '
    '
    <
    &lt;
    >
    &gt;
    &
    &amp;
    If a carriage return character is required in the text, it will be replaced with "\r".

  2. If you find it cumbersome to copy the CSLTranslationComparisonTable.locale file every time, using symbolic links is useful.

  3. The directory where Cities.exe is located can be opened directly from the steam properties screen.
    https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=760447682
5 Comments
jiben_yy 28 Apr, 2020 @ 6:42am 
Thank you. Good Job.
ibotaro  [author] 28 Apr, 2020 @ 4:16am 
@jiben_yy
It's a bug in this MOD.
Please see the update history for the cause of the bug.

Thank you for reporting the bug.
jiben_yy 28 Apr, 2020 @ 1:03am 
I'm glad to get a awesome mod. Immediately, I tried to use it.

However, I thought, the localefile does maybe not converted perfectly.
example; name variations is poor.
Probably, INDEX=0 were ONLY converted, weren't?
Or I was operated the wrong way.
Or the way to edit XML file is wrong.

May I question In Japanese, OK?
ibotaro  [author] 15 Apr, 2020 @ 3:52pm 
Thank you for teaching me.
Actually, I know how to do it, but like my other mods, I haven't implemented it because of the following two reasons.
1.The method changes depending on the OS, but OSX / macOS / Ubuntu cannot be prepared, so testing cannot be done.
2. Steam already has equivalent functionality.
Thank you for your cooperation.
leftbehind 14 Apr, 2020 @ 10:13pm 
You can provide button on mod options screen to open folder where files are - see comments [github.com].