How to add localization to a map

The information on this page is specific to Enemy Territory: Quake Wars .


Any text you may want to show up in-game has to be available for translation. The exception thus far is the “Pretty Name” in your pakmeta.conf; probably because this should be viewed as a proper noun that shouldn’t be translated. Anyway, in our <savepath>/base/mapinfo/<yourmap>.md we had these three lines:

"mapLocation"    "maps/<yourmap>/location"
"mapBriefing"   "maps/<yourmap>/briefing"
"campaignDescription"   "maps/<yourmap>/campaign"

These are text strings used in the loading screen (and lobby menu) for your map. The first describes the physical location like “New Jersey, United States of America” or whatever. The second is an overview of the objectives and the last is a name for your campaign.

Like in all text that we may want to show the user, to add these pieces of text we need two things: a) A name for the string reference. b) The contents of the string to be referenced. String references are stored in <savepath>/base/localization/locstr/ while the strings themselves are stored in <savepath>/base/localization/english/. These two files have to be created with an editor that can output UTF-8 encoded files.

String references

  1. Create a file in <savepath>/base/localization/locstr/maps/<yourmap>.locstr
  2. Paste the following into this file:
locString maps/<yourmap>/location { text "#str_<yourmap>_000" }
locString maps/<yourmap>/briefing { text "#str_<yourmap>_001" }
locString maps/<yourmap>/campaign { text "#str_<yourmap>_002" }

On each of those lines we first tell the game we’re defining a localization string, then we give the name of the localized string, then inside the curly brackets we reference the string proper. All strings are required to start with #str_ but anything beyond that is fair game. We’ll use <yourmap> and then a number which should give you a fairly unique alphanumeric reference that shouldn’t clash with any existing string. Also, 1000 string references should be more than enough for one map.

Strings

  1. Create a file in <savepath>/base/localization/english/strings/<yourmap>.lang
  2. Paste the following into this file:
{
"#str_<yourmap>_000" "Middle of the Pacific, Earth"
"#str_<yourmap>_001" "GDF have construct a wall."
"#str_<yourmap>_002" "Oceania"
}

This is fairly simple. First we give the same string reference we had definined and then we put the text proper. Now load <yourmap> and you should be able to see this text in the loading screen.