Localize Asset: Difference between revisions

From COD Engine Research
 
No edit summary
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
__NOTOC__
__NOTOC__
[[:Category:Assets]]
[[Category:Assets]]
[[:Category:CoD4]]
[[Category:CoD4]]
[[:Category:MW2]]
[[Category:MW2]]
[[:Category:MW3]]
[[Category:MW3]]
[[:Category:Ghosts]]
[[Category:Ghosts]]
[[:Category:WaW]]
[[Category:AW]]
[[:Category:BO1]]
[[Category:WaW]]
[[:Category:BO2]]
[[Category:BO1]]
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 Ghosts.
[[Category:BO2]]
[[Category:BO3]]
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 Black Ops 3.
  struct LocalizeEntry
  struct LocalizeEntry
  {
  {
Line 27: Line 29:
For example take the following localized string in the "exe.str",
For example take the following localized string in the "exe.str",
  REFERENCE          SERVERISFULL
  REFERENCE          SERVERISFULL
LANG_ENGLISH        "Server is full."
Also notes and flags can be applied to individual localized strings, which are skipped by the compiler, like so
REFERENCE          SERVERISFULL
NOTES              "The string returned when a client tries to join a game that is filled"
FLAGS              "0"
  LANG_ENGLISH        "Server is full."
  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."
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."

Latest revision as of 07:06, 31 October 2015

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 Black Ops 3.

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,

REFERENCE           NAME
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",

REFERENCE           SERVERISFULL
LANG_ENGLISH        "Server is full."

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

REFERENCE           SERVERISFULL
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."