Search Unity

should you use localization assets instead of making your own if you are just swapping strings?

Discussion in 'General Discussion' started by Mike01923, Dec 1, 2020.

  1. Mike01923

    Mike01923

    Joined:
    Jun 19, 2015
    Posts:
    195
    There a few localization assets that seems pretty complex, and there's a new built-in localization tool that is being developed atm. My question is, should I even bother using any of that if all I need are string replacements for buttons and such? Do they offer any benefit for someone who just needs strings replaced in textmeshpro fields?
     
    pKallv likes this.
  2. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,706
    There's something to say for the simplicity of writing your own purpose-built code. But make it modular so you can easily swap it out it if you find later that you need to do more and want to use an off the shelf solution. For example, maybe you need to replace strings in more than just TMP fields, or you need to localize images/icons, or you need to use different fonts for different languages, or your translators want to import and export Excel files and you don't want to deal with writing an importer.
     
    Joe-Censored likes this.
  3. pKallv

    pKallv

    Joined:
    Mar 2, 2014
    Posts:
    1,191
    Very interesting question. I did my own localisation which felt pretty easy from start but when I was done it ended up with a fair bit of complexity. Any preferable localisation solution to be recommended?
     
    Joe-Censored likes this.
  4. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,706
    Unity is developing a built-in Localization package. I don't know the latest status of it.

    Inter-Illusion's i2 Localization is quite popular.
     
    Joe-Censored and pKallv like this.
  5. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    "string replacements for buttons and such" can end up more complex than it sounds, since these strings will be different lengths. You might end up actually needing different font sizes, different fonts themselves for uncommon characters or character accents, a resizing of buttons, etc. I'd assume that some or all localization packages implement this kind of thing. If you go the route of making all your text fields large enough so all localizations easily fit, they probably won't look right in any language, since you'll end up with oversized text fields and buttons for the text displayed in most languages.