1
\$\begingroup\$

Are there any standard formats that can be used as the source material for game texts (i.e. subtitles, UI texts, etc.)? I can think of the following constraints:

  • at least some style effects (e.g. bold, italics)
  • at least some format string support (e.g. you found %d gold, you found {count} gold)
  • be translator-friendly: either easy to grasp, or standard enough that translation companies may already have experience with it

I know about the following but none of them appear to support format strings. Are there any industry standards for that or does every game or engine roll their own format?

  • UE4 uses a custom rich text format (example: Hello <RichText.Emphasis>everyone</>!)
  • Unity uses its own HTML-like format (example: Hello <b>everyone</b>!)
  • the srt format uses HTML-like syntax, too (example: Hello <b>everyone</b>!)
  • BBCode is another popular format (example: Hello [b]everyone[/b]!)
\$\endgroup\$
2
  • 2
    \$\begingroup\$ Are you a member of the International Game Developers Association &/or have access to their content (perhaps through company or team connection)? The have a Localization SIG w/ a best practices document; I'm not a member myself & don't have the full reference, but if you're interested, I could put what I did find into an answer. \$\endgroup\$
    – Pikalek
    Jan 6, 2021 at 19:18
  • \$\begingroup\$ Thanks for the hint! I found a 2012 version of the document and I believe at least one coworker is an IGDA member so I will ask them. \$\endgroup\$ Jan 7, 2021 at 13:03

2 Answers 2

2
\$\begingroup\$

The translation companies I've worked with use CSV or po (gettext) files. However, those formats don't specify how format/replacement strings or text formatting should work.

I've found that labelled replacements like "you found {count} gold" work better than numbered placeholders. C# style numbered placeholders resulted in questions from translators about what words replace the {1}, etc. That meant I had to compile a legend for each format string before sending out translations.

For text formatting, I'm not sure it matters much so long as you're clear to translators that they shouldn't change that markup or translate anything inside them. We use html-like tags. I think this format will likely be engine-specific because you may inject images into your strings (for button icons) or other game-specific text features.

\$\endgroup\$
1
  • \$\begingroup\$ +1 anytime I've worked with translators, spreadsheet formats were preferred, and descriptive labels in placeholders work much better than numbers, especially where strings might have multiple substitutions. \$\endgroup\$
    – DMGregory
    Jul 28, 2023 at 20:57
1
\$\begingroup\$

Use whatever is easiest for you/your team to work with. Personally I always use XML because that means I can parse the tags at the same time as I parse the storage container the strings are in:

<Translations Language="en-gb">
    <SomeNPC>
        <!-- An unknown tag <[something] /> is shorthand for <Param Id="[something]" /> -->
        <Greeting>Hello <player />! <weatherReaction /> weather, am I right?</Greeting>
    </SomeNPC>
</Translations>

<!-- Then just use like: 
    > i18n.translate("SomeNPC.Greeting", {player: "John", weatherReaction: "Nice"});
    Hello John! Nice weather, am I right?
-->

The reason for tags is that it becomes trivially easy to perform "advanced" translations:

<CakeCount>
    I have 
    <Select>
        <If Var="cakeCount" Equals="0">no</If>
        <If Var="cakeCount" Equals="1">one</If>
        <If Var="cakeCount" GreaterThan="1"><Param Id="cakeCount" /></If>
    </Select>
    <Select>
        <If Var="cakeCount" Equals="1">cake</If>
        <Else>cakes</Else>
    </Select>
</CakeCount> 

<!-- Then just use like: 
    > i18n.translate("CakeCount", {cakeCount: 6});
    I have 6 cakes
-->

As for your question about translation companies, many companies have their own "format" they want the text in (e.g. just a .txt with each translation numbered and on separate lines) so you would follow that. If they don't want "styled" text (with tags etc.) then you just have to work around it or find another company, but most people are aware of what HTML looks like so a simple explanation to not translate the tags should be enough.

If you have in-house translators you just train them in whatever format you decide to use, and XML is easy to understand (translate all text, except stuff between < and >).

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .