Translating

From Empires Wiki
Revision as of 19:30, 13 July 2016 by Thexa4 (talk | contribs) (Created page with "Translating the game is done using VGui Localization (https://developer.valvesoftware.com/wiki/VGUI_Documentation#Localization). The individual language files are generated by...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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 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.