Difference between revisions of "Localization of base game and mods"

From Nebuchadnezzar Modding Wiki
Jump to navigation Jump to search
 
(18 intermediate revisions by the same user not shown)
Line 2: Line 2:
 
There are two types of data for localization.
 
There are two types of data for localization.
 
=== General data ===
 
=== General data ===
This data are used in the game regardless used mods.
+
Data used in the game regardless used mods.
 
*Example: main menu buttons, employees activies, amployees types, screen names etc.
 
*Example: main menu buttons, employees activies, amployees types, screen names etc.
  
 
=== Mods data ===
 
=== Mods data ===
Data related to spcific mod.
+
Data related to specific mod.
 
*Example: mission description, building names, goods names etc.
 
*Example: mission description, building names, goods names etc.
 
*Do not forget that all Nebuchadnezzar missions and game data are also in the mod, so all related localization are in the mod as well.
 
*Do not forget that all Nebuchadnezzar missions and game data are also in the mod, so all related localization are in the mod as well.
 +
 +
== Localization files ==
 +
 +
=== General data ===
 +
Localization files for general strings are located at <code>[game installation folder]/data/locale/[language name].lua</code>
 +
*Look at existing files to understand the file format.
 +
*Name of the file is the '''name of this language''' player can select in the game.
 +
*If you want to '''add new language''', simply create valid localization file in this folder and that's all. Game will detect new language at next start.
 +
 +
=== Mods data ===
 +
Localization files for mod strings are located at <code>[mod data folder]/locale/[language name].lua</code>
 +
*Look at existing files to understand the file format.
 +
*'''Name''' of the file '''must be same''' as the name of general localization file of the '''appropriate language'''.
 +
**It also means that if you want to create localization for mod data only in a language which has no general data localization file, you have to create this general localization file (even if it won't contains any data) for game be able to select this language.

Latest revision as of 16:41, 20 October 2021

General localization vs mods localization[edit]

There are two types of data for localization.

General data[edit]

Data used in the game regardless used mods.

  • Example: main menu buttons, employees activies, amployees types, screen names etc.

Mods data[edit]

Data related to specific mod.

  • Example: mission description, building names, goods names etc.
  • Do not forget that all Nebuchadnezzar missions and game data are also in the mod, so all related localization are in the mod as well.

Localization files[edit]

General data[edit]

Localization files for general strings are located at [game installation folder]/data/locale/[language name].lua

  • Look at existing files to understand the file format.
  • Name of the file is the name of this language player can select in the game.
  • If you want to add new language, simply create valid localization file in this folder and that's all. Game will detect new language at next start.

Mods data[edit]

Localization files for mod strings are located at [mod data folder]/locale/[language name].lua

  • Look at existing files to understand the file format.
  • Name of the file must be same as the name of general localization file of the appropriate language.
    • It also means that if you want to create localization for mod data only in a language which has no general data localization file, you have to create this general localization file (even if it won't contains any data) for game be able to select this language.