1. Hello Guest! It's with a heavy heart that we must announce the removal of the Legacy GMC Archive. If you wish to save anything from it, now's the time! Please see this topic for more information.
    Dismiss Notice

Best way to add language localization to your apps

Discussion in 'Programming' started by RizbIT, Apr 3, 2019.

  1. RizbIT

    RizbIT Member

    Joined:
    Jun 24, 2016
    Posts:
    471
    I found some translation extensions: for one you have to create langauge files with content like this

    Example of a language file (from { to }):

    So you would manually enter all text used in the app and the translated version for each language.

    Then anywhere you have for example draw_text("text",x,y)
    you would have to replace it with
    draw_text(nat("text"),x,y)

    Thats a fair bit of work, searching for all text in the app and replacing and manually.

    Is there any other way? ideally i would want an extension that can say intercept all text being sent to the screen and auto translate it to the language set by the user.

    Thanks
     
  2. FrostyCat

    FrostyCat Member

    Joined:
    Jun 26, 2016
    Posts:
    4,699
    No, there isn't. It's your fault for writing code that doesn't have localization in mind from day one. You made your bed, now sleep on it.

    Unless all screen-bound text in your project already goes through a script you control, you can't intercept it without recoding those parts to go through that script. And the part about "auto translate" is just ludicrous. Translating between human languages isn't a mechanical exercise like translating English to Pig Latin. It's absurd how your faith in automated translation still seems to be intact, even though several non-monolinguals on this topic have already told you how badly the output presents itself to a native speaker. And these are already state-of-the-art algorithms that run on the cloud, not simple word-for-word mappers. Having to submit translation queries to the cloud during the final product's runtime also presents a serious latency, privacy and network traffic issue.

    Google doesn't punish you for badly translated text, its algorithms don't know jack what doing it properly looks like. It's the end users speaking the target language who will punish you for mangling their native tongue. So quit trying to cut corners and start getting human translators involved. And if you can't afford to do a sensible job, don't do it at all.
     
  3. Tsa05

    Tsa05 Member

    Joined:
    Jun 21, 2016
    Posts:
    560
    Any dialog engine that does not use external files to load dialog is not a dialog engine.
    /opinion

    Really, it's worth the time, right now, to go through your engine and even just replace the draw_text(x,y, "specific text") commands with variables, and load them from a file. Wouldn't be a proper engine, but that's still better than hard coding your text in pretty much any cases. When you decide you want to alter your text, add text, fix typos, translate, add dlc, patch, etc... you're always going to have a better time with externally loaded text.
     
    RizbIT likes this.
  4. RizbIT

    RizbIT Member

    Joined:
    Jun 24, 2016
    Posts:
    471
    yeah im going to have to, tbh its not something i would have considered before just i read localization can improve your userbase
     
  5. dannyjenn

    dannyjenn Member

    Joined:
    Jul 29, 2017
    Posts:
    571
    You could probably write some sort of a script that would automatically go through your project file and move all the hard-coded strings into a separate file. But once you have the text in a separate file, you'd still need to translate it somehow.
     
  6. RizbIT

    RizbIT Member

    Joined:
    Jun 24, 2016
    Posts:
    471
    by project file do you mean the apk or the GMS project file?
     
  7. RizbIT

    RizbIT Member

    Joined:
    Jun 24, 2016
    Posts:
    471
    is there any font that supports non english letters like french and hindi for localization?
     
  8. dannyjenn

    dannyjenn Member

    Joined:
    Jul 29, 2017
    Posts:
    571
    I mean the GMS project folder. You probably can't do this in GMS due to the sandboxing, but you'd write a program that would go through every file in your GMS project folder and basically replace every string with something like global.text[ i ] while simultaneously moving that piece of text into an external text file and incrementing i. Then all you'd need to do would be load the text line by line from that external file into global.text[ i ] at game start.

    Yes, but I don't know of any free ones off the top of my head. Most such fonts will probably follow the Unicode encoding standard, so you'll need to remember to adjust the font's character range (otherwise GMS will only include the English letters).
     
  9. FrostyCat

    FrostyCat Member

    Joined:
    Jun 26, 2016
    Posts:
    4,699
    There's an article on Motley Fool some time ago that trading options can get you rich. Why isn't everyone rich yet?

    If you find the above absurd, you should understand by now why I think your train of thought on this front is superficial and premature. Supporting more languages will obviously expand your audience. But at what cost? What skill does it take? And would you get more out of it than you put in?

    As I have already said, translating human languages isn't a mechanical word-for-word exercise, and most native speakers find the output of automated translation unpalatable. So just the text alone will take human effort to get right, and even more for ongoing support.

    But a proper localization doesn't just need to get the text right, it also needs to get the culture right. This is the part where things can get expensive and difficult, and some combinations can get downright sticky and involve more than just the text. For example, English-Japanese localization is notorious for involving almost everyone on board revamping existing assets. Though English-Hindi localization isn't as notorious, in GM particularly there's a show-stopper in its text rendering system, and you still have to get the text and the culture right.

    If the language isn't adequately represented in your target audience, don't try to support it. If implementing the additional language requires too much effort to accommodate it, don't try to support it. Trying to be everyone's friend and supporting many languages poorly is a shallow thing to do.

    He means adding the languages as Included Files.

    Arial Unicode is one of them, and so are most fonts already supporting the Devanagari range (e.g. Kruti, Mangal, Nirmala).

    But with GM, the choice of font is only a superficial bottleneck, it's the built-in surface-based text system's inability to do CTL that's the real bottleneck. The individual characters won't line up or link properly, and a native speaker would find the result an illegible mess. Unless you manage to integrate something like Harfbuzz, Pango or another custom font rendering solution, getting Hindi to work is a pipe dream for current versions of GM.
     
  10. RizbIT

    RizbIT Member

    Joined:
    Jun 24, 2016
    Posts:
    471
  11. RizbIT

    RizbIT Member

    Joined:
    Jun 24, 2016
    Posts:
    471
    in case in benefits others...

    I added 3 new human made language translations to the store listing, what I found was that it did not increase number of installs, in fact it caused significant decrease...
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice