Localize Asset

From COD Engine Research
Revision as of 09:18, 28 December 2014 by CraigChrist8239 (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Localize assets are by far the simplest asset to work with. These take the normal concept of localized strings, in that developers can use a simple ID string that will find the localize asset with the appropriately formatted string, so language experts and translators conflict with programmers as little as possible. This asset is so simple, that it hasn't changed from the leaked Call of Duty 4 Alpha all the way up to Advanced Warfare.

struct LocalizeEntry
  const char *value;
  const char *name;

Where name would be the ID the developer uses, and then value would be the translated string for this version of the game.

Source Format

The localized strings are located in ".str" files at the path "raw/english/localizedstrings/". The ".str" file can have normal C++ notes, and is preceded with the following header.

VERSION             "1"
CONFIG              "C:\trees\cod3\cod3\bin\StringEd.cfg"
FILENOTES           ""

Each string is then separated into ".str" files by category, with the file name being appended to the localized strings at compilation. Each individual string is stored in a ".str" file like so,

LANG_ENGLISH        "Value"

Then each language is added like so. Be aware that the value "#same" will copy the text from the english version of the game.

LANG_GERMAN         "Wert"

For example take the following localized string in the "exe.str",

LANG_ENGLISH        "Server is full."

Also notes and flags can be applied to individual localized strings, which are skipped by the compiler, like so

NOTES               "The string returned when a client tries to join a game that is filled"
FLAGS               "0"
LANG_ENGLISH        "Server is full."

If you compiled this for the english version of the game, it would produce the localized string EXE_SERVERISFULL with the value "Server is full."