Translate Game Texts - defterai/StarCitizenModding GitHub Wiki
English language - /data/Localization/english/global.ini
Other languages - /data/Localization/<language>/global.ini
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
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
- Use Notepad++ or other file editor applications
- Use smartCAT or other online tools for translation of imported file
Before use those Python script below please ensure you are install latest Python 3 with pip (python package manager)
python -m pip install pandas
python -m pip install xlrd
python -m pip install xlsxwriter
- Convert latest English
global.ini
file to xlsx format byini-to-xlsx.py
script
python ini-to-xlsx.py global.ini global.xlsx
- Import result xlsx file inside smartCAT
- Translate in smartCAT
- Put in directory with scripts latest English
global.ini
and rename it toglobal_ref.ini
- Download translation from smartCAT as xlsx file
- Convert xlsx back to ini format by
xlsx-to-ini-with-ref.py
script (it also auto mergeglobal_ref.ini
with your translation)
python xlsx-to-ini-with-ref.py global.xlsx global.ini
- In case script report some important issues fix them in smartCAT and repeat steps 2-4
- Copy result
global.ini
to/data/Localization/<language>/
folder and test in game
- Download translation from smartCAT as xlsx file
- Convert xlsx back to ini format by
xlsx-to-ini.py
script
python xlsx-to-ini.py global.xlsx global.ini
- In case script report some important issues fix them in smartCAT and repeat steps 1-3
- Copy result
global.ini
to/data/Localization/<language>/
folder and test in game
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