File: WZJsonLocalizedString.md

package info (click to toggle)
warzone2100 4.6.3-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 660,320 kB
  • sloc: cpp: 676,209; ansic: 391,201; javascript: 78,238; python: 16,632; php: 4,294; sh: 4,094; makefile: 2,629; lisp: 1,492; cs: 489; xml: 404; perl: 224; ruby: 156; java: 89
file content (30 lines) | stat: -rw-r--r-- 1,451 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# WZ JSON Localized String

Warzone 2100 supports specifying localized strings in certain JSON files.

Anything that's listed as `(JSON Localized String)` may either be:

- A (string) value
  - Example:
  ```json
  "description": "A description of the mod in English, and only English."
  ```
- _Verbose Form:_ An (object) with a key for each language code and a (string) value that is the translation
  - Example:
  ```json
  "description": {
    "en": "A description of the mod in English."
    "de": "The same description, but in German."
  }
  ```
  - Note:
    - The base / default language for the game is English (`"en"`). We strongly recommend that you _always_ provide an `en` translation of all localized strings.
    - The language codes correspond to the ones supported by the game (see the `.po` files in: https://github.com/Warzone2100/warzone2100/tree/master/po)

## Recommendations:

- For JSON Localized String values in files bundled with the game:
  - These should generally just be normal JSON string values _in WZ's "base" language (English)_
  - They will automatically be included in the message catalogs, and translations will be managed via Crowdin
- For values in files in a mod which is distributed separately:
  - If you want to include your own bundled translations for these strings, you can optionally use the verbose form of a JSON Localized String (the object form, which contains keys/values for different languages)