Difference between revisions of "Modding: Localization"

From Divinity Engine Wiki
Jump to: navigation, search
m (_to_F added)
(File structure)
Line 9: Line 9:
 
In ''~DivinityEngineDataPath~\Data\Editor\Localization\English'' you can find example files that show the file structure:
 
In ''~DivinityEngineDataPath~\Data\Editor\Localization\English'' you can find example files that show the file structure:
 
* '''''Gender/Female/english.xml''''': contains specific lines when the speaker's gender is taken into account (speaker is female).
 
* '''''Gender/Female/english.xml''''': contains specific lines when the speaker's gender is taken into account (speaker is female).
* '''''Gender/Female/english_to_F.xml''''': contains specific lines when the speaker's gender and the person they're talking to are taken into account (both known female).
+
* '''''Gender/Female/english_to_F.xml''''': contains specific lines when the speaker's gender and the person they're talking to are taken into account (both known female). [Does not exist for english]
 
* '''''Subtitles/...''''': Contains subtitle files for all videos. Videos files themselves are not provided due to size. You can also add new files here if your project has custom movies.
 
* '''''Subtitles/...''''': Contains subtitle files for all videos. Videos files themselves are not provided due to size. You can also add new files here if your project has custom movies.
 
* '''''english.xml''''': Contains all regular lines for the specific language (English in this example)
 
* '''''english.xml''''': Contains all regular lines for the specific language (English in this example)
* '''''english_to_F.xml''''': Contains specific lines when the addressee's gender is female (male addressing female).
+
* '''''english_to_F.xml''''': Contains specific lines when the addressee's gender is female (male addressing female). [Does not exist for english]
 
* '''''language.lsx''''': Defines the language by name. This is a copy of the file in ''~DivinityEngineDataPath~\Data\Localization''. The file in that location determines which language is active in-game.
 
* '''''language.lsx''''': Defines the language by name. This is a copy of the file in ''~DivinityEngineDataPath~\Data\Localization''. The file in that location determines which language is active in-game.
  
 
<br />
 
<br />
 +
 
== Language Spreadsheet ==
 
== Language Spreadsheet ==
  

Revision as of 15:50, 8 March 2018

Localization files are used to provide the different languages in which the game can be played.
It is possible to create a similar file structure in your own Add-on or Adventure.
This way, you can alter existing languages or provide your own.


File structure

In ~DivinityEngineDataPath~\Data\Editor\Localization\English you can find example files that show the file structure:

  • Gender/Female/english.xml: contains specific lines when the speaker's gender is taken into account (speaker is female).
  • Gender/Female/english_to_F.xml: contains specific lines when the speaker's gender and the person they're talking to are taken into account (both known female). [Does not exist for english]
  • Subtitles/...: Contains subtitle files for all videos. Videos files themselves are not provided due to size. You can also add new files here if your project has custom movies.
  • english.xml: Contains all regular lines for the specific language (English in this example)
  • english_to_F.xml: Contains specific lines when the addressee's gender is female (male addressing female). [Does not exist for english]
  • language.lsx: Defines the language by name. This is a copy of the file in ~DivinityEngineDataPath~\Data\Localization. The file in that location determines which language is active in-game.


Language Spreadsheet

The spreadsheet at ~DivinityEngineDataPath~\Data\Editor\Localization\loca_full.xls contains all the game's english lines.
It is recommended to use this file for translating a language, opposed to manually editing the language.xml files.

The spreadsheat has columns for the different types of translations, which can be exported:

  • column F: translation - male to male or default translation
  • column G: translation_F - female speaker to male or to anyone if H not filled in
  • column H: translation_to_F - male to female or any to female if I not filled in
  • column I: translation_F_to_F - female speaker to female speaker


Best Practice

  1. Do not sort or reorder anything. Only type in columns F to I.
  2. Developer comments, context and other information is available in columns J, K, L, etc.
  3. In "DIALOGUES" tabs, if you are wondering who says the line, look at column N and O.
  4. Columns G, H and I are only for "DIALOGUES" tabs and are not taken into account in any other tab.


Exporting

The translations from the different columns go to the following files:

  • column F: ~DivinityEngineDataPath~\Data\Editor\Mods\YourMod\Localization\YourLanguage\YourLanguage.xml
  • column G: ~DivinityEngineDataPath~\Data\Editor\Mods\YourMod\Localization\YourLanguage\YourLanguage_to_F.xml
  • column H: ~DivinityEngineDataPath~\Data\Editor\Mods\YourMod\Localization\YourLanguage\Gender\Female\YourLanguage.xml
  • column I: ~DivinityEngineDataPath~\Data\Editor\Mods\YourMod\Localization\YourLanguage\Gender\Female\YourLanguage_to_F.xml


The Visual Basic script, at ~DivinityEngineDataPath~\Data\Editor\Localization\export.vb can be used to automate this process for Microsoft Excel.