Translating

From Empires Wiki
Jump to navigation Jump to search

Translating the game is done using VGui Localization (https://developer.valvesoftware.com/wiki/VGUI_Documentation#Localization). The individual language files are generated by: http://translate.empiresmod.com/

Translation Workflow (Developers)

  1. Create a feature that requires text messages to be sent to the user.
  2. Add a new section to mp/game/empires/resource/empires_template.txt:
    // Great new feature
  3. Create identifiers with their english version for the strings you use:
    "emp_great_hello" "Hello World"
    "emp_great_tip" "Tip: %s1"
    "emp_great_press" "Now press %k{+use} to build this building"
  4. Lookup the localized strings in code:
    1. By using the ClientMessage system:
      ClientPrint(player, HUD_PRINTCENTER, "#emp_great_tip", "#emp_great_press");
      // Prints: "Tip: Now press E to build this building"
    2. By using javascript:
      translation.lookup("#emp_great_tip", "#emp_great_press")
      // Returns: "Tip: Now press E to build this building"
    3. By using a manual lookup:
      const char *message = g_pVGuiLocalize->FindAsUTF8("#emp_great_press");
      char expanded[2048];
      ExpandPrintFKeyNames(expanded, sizeof(expanded), message);
      // expanded now contains: "Now press E to build this building"
  5. You can temporarily copy the empires_template.txt over the empires_english.txt file to test your changes. Make sure not to commit it though. (The encoding is weird and won't be merged correctly)
  6. Create a pull request.
  7. Get your pull request accepted into develop.
  8. The translation system now automatically adds the new strings to the translation system.
  9. Translators will see new strings they can translate.
  10. Once strings are translated new compiled versions will appear once an hour at http://translate.empiresmod.com/compiled/ and will appear in the repo in the empires_assets:translations branch.
  11. You can place these in mp/game/empires/resources/ to test our your feature in other languages.
  12. Before a release the translations branch will be merged into develop.

Translation Workflow (translators)

  1. Contact one of the developers to get translation access.
  2. Sign the Contributors Agreement.
  3. Log in to http://translate.empiresmod.com with the credentials you received.
  4. Start translating strings for the languages you're proficient with.
  5. The strings you translate can be placed in game by using the files at http://translate.empiresmod.com/compiled/ These files are updated once an hour if someone updates a translation. You can place these files in the empires/resource/ folder in your empires install.
  6. The updated strings will be merged before a release so make sure you check the website regularly to see if there are more strings to translate. (If certain strings aren't translated before a release those messages will appear in English.

Changing a description in game

  1. Download the template file from http://translate.empiresmod.com/compiled/empires_template.txt
  2. Make the changes to the descriptions. Be sure to keep the keys the same.
  3. Send the changed file to one of the developers, preferably by uploading the file to the Translations channel in hipchat.
  4. If the developers decide to merge your changes the strings will update automatically for all languages.
  5. Add translations for all languages
  6. Go play the game after release :)

Language differences

Some strings can't be translated to carry the exact same meaning while maintaining simplicity of use. Because of that, there are certain small discrepancies between the translations. Below are examples of these.

Polish translation

English Polish
Bullet Projectile Nabój
Fission Reactor Reaktor Atomowy
Sergeant First Class Chorąży
Master Sergeant Starszy Chorąży
Scoped Rifle Karabin Wyborowy
Heavy-Duty Ciężki
Sticky Stun Bomb Lepka Bomba Grzewcza