Translate Game Texts - defterai/StarCitizenModding GitHub Wiki

Location of localization text file

English language - /data/Localization/english/global.ini
Other languages - /data/Localization/<language>/global.ini

Format of localization text file

Game localization file is key value text file which used UTF-8 encoding with BOM in the file start.
Each key is separated from value by = character and value separated from next key by Newline character (in original file used LF: Line Feed, U+000A) In scope of localization process should be changed only value part of each line

Special character sequences in value

Some sequences of characters are used by game for different purposes and should be not translated

  • Special symbols: \n - newline
  • Unnamed variables and tags (do not change order or delete them): %ls, %s, %S, %i, %I, %u, %d, %[0-9.]*f, <[^>]*>
    Example: %ls, %.*f, %0.0f, <font color="#660099">, </font>, <b>, </b>
  • Named variables (order can be changed): ~[a-z]+\([^\)]*\)
    Example: ~mission(Location), ~mission(Location3|Address)
  • Unknown purpose (please not remove them): @

Deals with conflicts:

  • For show \n sequence in game just put additional \ character before it - \\n
  • For show any unnamed format character sequence in game (as example: %s) use second % character before it - %%s

There is two way localization of game texts

  1. Use Notepad++ or other file editor applications
  2. Use smartCAT or other online tools for translation of imported file

Using smartCAT for translation

Before use those Python script below please ensure you are install latest Python 3 with pip (python package manager)

Install required python libraries

python -m pip install pandas
python -m pip install xlrd
python -m pip install xlsxwriter

Import into smartCAT

  1. Convert latest English global.ini file to xlsx format by ini-to-xlsx.py script

python ini-to-xlsx.py global.ini global.xlsx

  1. Import result xlsx file inside smartCAT
  2. Translate in smartCAT

Export from smartCAT - with merge to latest ini

  1. Put in directory with scripts latest English global.ini and rename it to global_ref.ini
  2. Download translation from smartCAT as xlsx file
  3. Convert xlsx back to ini format by xlsx-to-ini-with-ref.py script (it also auto merge global_ref.ini with your translation)

python xlsx-to-ini-with-ref.py global.xlsx global.ini

  1. In case script report some important issues fix them in smartCAT and repeat steps 2-4
  2. Copy result global.ini to /data/Localization/<language>/ folder and test in game

Export from smartCAT - without merge to latest ini (not recommended)

  1. Download translation from smartCAT as xlsx file
  2. Convert xlsx back to ini format by xlsx-to-ini.py script

python xlsx-to-ini.py global.xlsx global.ini

  1. In case script report some important issues fix them in smartCAT and repeat steps 1-3
  2. Copy result global.ini to /data/Localization/<language>/ folder and test in game

Configure convert scripts

You can configure convert scripts by convert.ini settings file

[general]
allow_outdated_translation = true  ; use not migrated keys in result general.ini if no changes in variables (xlsx-to-ini-with-ref)
exclude_translate_keys =           ; list of keys divided by , which should be always not translated (xlsx-to-ini-with-ref)

; additional verification's for (xlsx-to-ini-with-ref)
[verify]
english_words_mismatch = false     ; search for mismatch of English words between translation and original
space_before_newline = false       ; search for spaces between newline to reduce file size
lost_newline = false               ; search for corrupted \n sequence (n was removed)

; split (ini-to-xlsx) or merge (xlsx-to-ini-with-ref) files to workaround smartCAT 50k keys limits
[split-documents]
names.ini = Human_First_Names_, Human_Surnames_, Human_Nicknames_  ; specify additional file names and key prefixes moved to those files
⚠️ **GitHub.com Fallback** ⚠️