Difference between revisions of "Modding: Localization"

From Divinity Engine Wiki
Jump to: navigation, search
(Created page with " Localization files are used to provide the different languages in which the game can be played.<br /> It is possible to create a similar file structure in your own My_first...")
 
(File structure)
 
(9 intermediate revisions by 2 users not shown)
Line 8: Line 8:
  
 
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.
+
* '''''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 example files]
 
* '''''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). [Does not exist for English example files]
 
* '''''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 />
 +
You can also get the example files directly from [[:File:Localization.zip|here]].
 +
<br />
  
<br />
 
 
== Language Spreadsheet ==
 
== Language Spreadsheet ==
  
The spreadsheet at [i]~DivinityEngineDataPath~\Data\Editor\Localization\loca_full.xls[/i] contains all the game's english lines.<br />
+
The spreadsheet at ''~DivinityEngineDataPath~\Data\Editor\Localization\loca_full.xls'' contains all the game's english lines.<br />
 
It is recommended to use this file for translating a language, opposed to manually editing the language.xml files.
 
It is recommended to use this file for translating a language, opposed to manually editing the language.xml files.
  
Line 37: Line 41:
  
 
The translations from the different columns go to the following files:<br />
 
The translations from the different columns go to the following files:<br />
* '''column F''': '''''~\YourLanguage.xml'''''
+
* '''column F''': '''''~DivinityEngineDataPath~\Data\Editor\Mods\YourMod\Localization\YourLanguage\YourLanguage.xml'''''
* '''column G''': '''''~\YourLanguage_to_F.xml'''''
+
* '''column G''': '''''~DivinityEngineDataPath~\Data\Editor\Mods\YourMod\Localization\YourLanguage\YourLanguage_to_F.xml'''''
* '''column H''': '''''~\Gender\Female\YourLanguage.xml'''''
+
* '''column H''': '''''~DivinityEngineDataPath~\Data\Editor\Mods\YourMod\Localization\YourLanguage\Gender\Female\YourLanguage.xml'''''
* '''column I''': '''''~\Gender\Female\YourLanguage_to_F.xml'''''
+
* '''column I''': '''''~DivinityEngineDataPath~\Data\Editor\Mods\YourMod\Localization\YourLanguage\Gender\Female\YourLanguage_to_F.xml'''''
 
<br />
 
<br />
  
The Visual Basic script, at ''~DivinityEngineDataPath~\Data\Editor\Localization\export.vb'' can be used to automate this process for Microsoft Excel.
+
The Visual Basic script, at ''~DivinityEngineDataPath~\Data\Editor\Localization\export.vb'' can be used to automate this process for Microsoft Excel:<br />
 +
* Be sure to rename the language in the script to your desired language.<br />
 +
* When running the script, make sure the folder structure (YourLanguage/ and YourLanguage/Gender/Female) exists at the file location of the spreadsheet, or the export will be canceled.

Latest revision as of 17:29, 23 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 example files]
  • 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 example files]
  • 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.


You can also get the example files directly from here.

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:

  • Be sure to rename the language in the script to your desired language.
  • When running the script, make sure the folder structure (YourLanguage/ and YourLanguage/Gender/Female) exists at the file location of the spreadsheet, or the export will be canceled.