Language Editor


Standalone version


 

Download Link : http://cossacksworld.ucoz.co.uk/load/c_iii_files/mod_map_tools/c3_official_language_editor/82-1-0-460

 

This tool is used for creating or altering the language files (.lng) which hold the translations into various languages for the game.

You can find the .lng and their .txt files in the data\locale folder.

The game knows which files to load by looking into the table.lib file. For example, in data\locale\en\table.lib you can read:


   [*] : struct.begin
      id = gui
      filename = .\data\locale\en\gui.lng
   struct.end


This tells the game that everything with the 'gui' id is located in that specific file and the game will attempt to load translations from that file.

In turn, data\locale\lang.loc states which .lib files to load for which language and which file is the default library.

If we load gui.lng with the language editor, you will see the following:

Each string has it's translation. You can make change here directly, add strings or remove strings.

Once you have done that, you should use 'save' and save as .lng . It's important that you immediately save again, but this time use, 'save as text' and overwrite the existing text file.

You can also load a file from a .txt file or .csv


Notes


- Inbuild language editor:

This tool is also built into the editor.exe. You can find it under Module - > Locale Table. It will open a slightly different screen with all the locale tables and from there you can edit each .lng file seperately.

- Cyrillic:
The official language editor doesn't display cyrillic ,so here's how to get around it and make adjustments to the russian/ukrainian language files:

Go to Editor.exe -> Modules -> Locale table -> Choose table -> Edit selected table -> File -> Save as TXT
Next open the text file you just saved in your preferred text editor (I use sublime text ), go to File -> Reopen with encoding -> Cyrillic (Windows 1251). It will now display cyrillic properly.
Edit the text file with your new entries.
File -> Save with encoding -> Cyrillic (Windows 1251)
Back to the editor.exe -> Modules -> Locale table -> Load as .txt -> Select your edited file -> Save as .lng

- Batch file:

- You can create a batch file to process multiple files at once.

Inside you would write something like this:
..\..\tools\locale\editorlang.exe .\en\units.txt .\en\units.lng c

Then run the batch file , make sure the batch file and tool are in the same folder.

- convert lang table from lng txt csv to lng txt csv. usage:
editorlang.exe name.lng name.txt c
editorlang.exe name.lng name.csv c
editorlang.exe name.txt name.lng c
editorlang.exe name.csv name.lng c

 

- Merger tool:

If you are not using the .csv files or batch file you could also use another tool, the 'form locale merger' tool. This tool allows you to quickly move any changes made to one file into another language file.

For example, if you have made changes to the english locale table, you can then quickly copy & move them to the french locale table and save. This can save some time if you are translating your mod descriptions in more than one language.

Download link to this tool: http://cossacksworld.ucoz.co.uk/load/c_iii_files/mod_map_tools/c3_merge_languages/82-1-0-469