Localized files are used because they concentracte all of the game data that's language(or region/country) specific and allow the developers to edit those files accordingly based on the language. In Call of Duty 2, all the localized strings are located at *.iwd/localizedstrings/.
To add a localized string to your map, you need to create a localized string file in the above location. The name has to be unique, otherwise it might overwrite already existing localized files. I would suggest to prefix it with your map name, then add an identifier at the end. The localized string files are simple renamed .txt files. The file extension is .str.
After you've created your blank localized string file(which should be at *.iwd/localizedstrings/<locstrfilename>.str), you should first paste this code into it:
Code: Select all
VERSION "1"
CONFIG "C:\trees\cod2\bin\StringEd.cfg"
FILENOTES "You can add your own notes here"
REFERENCE BLANK
LANG_ENGLISH " "
Each localized string is composed of a reference and the various languages it's translated to. We'll be using LANG_ENGLISH because it's (probably) the default and the language most people use with their CoD2. The reference has to be unique to your localized file, which means it's ok to use the same reference name in two different localized string files, but not in the same file if it's already defined. You can add strings to this file using the template for the blank string above:
Code: Select all
REFERENCE HELLO_WORLD
LANG_ENGLISH "Hello world, I am a localized string!"
Code: Select all
ENDMARKER
All localized strings you're planning on using have to be precached(loaded) before they can be used. To precache a localized string, call:
Code: Select all
precacheString(&"<locstrfilename>_<referencename>");
Code: Select all
precacheString(&"MP_TEST_UTILS_HELLO_WORLD");

This is part 1 of a bigger tutorial series, stay tuned for some even more interesing stuff in the near future!