Jump to content

How do i localise my game?


Abhishek Bharti
 Share

Recommended Posts

Many sponsors like pakap has requirement like localisation to french.

I want to ask how do you guys localise your game for these sponsors, do you use google translate or any other service?

I'm about to complete making my first html5 game and will be contacting sponsors in few days i want my game to be ready for such sponsors.

Link to comment
Share on other sites

Look in to using dictionary files.  Basically a dictionary file can be an array or JSON or however you want to store it of the original text and the translated text.

 

For example you might do:

var English = {    Hello : "Hello",    Yes : "Yes",    No : "No"};var Spanish = {    Hello : "Hola",    Yes : "Si",    No : "No"};

Then for when you are building your text you simply do something like:

userSelectedLanguage = Spanish;displayGreeting(userSelectedLanguage.Hello);

You can find a lot of dictionary files already out there for common phrases which should work fine for most games.

 

Here is one good website: http://www.localeplanet.com/

 

If you need complex text translated I would use a translation service and simply give them your English dictionary file and have them translate each phrase or word you need.

Link to comment
Share on other sites

Dumb question

Translate the game, worth?

 

The whole computing world speaks at least some English, that is true.  But when people are gaming they want to relax, not struggle to understand a second language.  They tend to choose games in their primary language first.

 

 

If you want more detailed information backed up with statistics, here is a link to my company's blog .

Link to comment
Share on other sites

Translation is really important, of course english should allways be an options.

But it's great to play a game in your own language, specially if it has lots of text dialogs like RPGs or adventure games.

 

Translating texts is easy, using a javascript object for each language.

The hard part is if you have images with text, then you have to copy them and translate the text.

Link to comment
Share on other sites

  • 1 year later...

I'm working on a game which supports multi-language, and I tried to just keep it simple. See source below
https://github.com/BdR76/MultiLanguage

It's an object that can load a .JSON file which contains the translated texts, but you can also just use the Phaser preloading/cache to set the json data.

// preloader
game.load.json('mylangs', '/url/languages.json')

// create object and set translated texts
var ml = new MultiLang();
ml.phrases = game.cache.getJSON('mylangs');

// get a text
var str = ml.get('HELLO_WORLD');

In my game there are no sprites/bitmaps with text on them, and I use a BitmapFont for the texts. Also I use a Excel spreadsheet to hold and edit all the translations, and generate the JSON data file (see here).
The only tricky part is that the BitmapFont must include all needed characters used in all the languages texts (for example "ä ß ö" for German, "á ç è" for French etc).
I use ShoeBox and Painshop to carefully prepare the bitmap fonts, and I don't know of any easier way than that.

Link to comment
Share on other sites

I definitely agree with @BdR's approach of not shipping text strings in your source, opting instead to load them in. If your translation files contains many many strings and you want to support many languages adding them all to your build is going to bump up your bundle weight, quite possibly prohibitively, particularly if you have to way of swapping translations in game, in which case all other languages become redundant and its useless code you're shipping to the browser.

i18next and formatjs are both excellent choices and support much trickier things like calculating different word endings and stuff like his/hers/theirs which can get really tricky across different languages, where the rules change.

If you just want string replacement though they might be overkill and a simple language switch might be best.

Link to comment
Share on other sites

  • 4 months later...
On 02/12/2016 at 3:46 PM, BdR said:

I'm working on a game which supports multi-language, and I tried to just keep it simple. See source below
https://github.com/BdR76/MultiLanguage

It's an object that can load a .JSON file which contains the translated texts, but you can also just use the Phaser preloading/cache to set the json data.


// preloader
game.load.json('mylangs', '/url/languages.json')

// create object and set translated texts
var ml = new MultiLang();
ml.phrases = game.cache.getJSON('mylangs');

// get a text
var str = ml.get('HELLO_WORLD');

In my game there are no sprites/bitmaps with text on them, and I use a BitmapFont for the texts. Also I use a Excel spreadsheet to hold and edit all the translations, and generate the JSON data file (see here).
The only tricky part is that the BitmapFont must include all needed characters used in all the languages texts (for example "ä ß ö" for German, "á ç è" for French etc).
I use ShoeBox and Painshop to carefully prepare the bitmap fonts, and I don't know of any easier way than that.

How do you create your bitmap font ( i know what software you use). I'm using webfontloader.js to load ttf or similar file type. if you need different charecter type for completely different languge like korean, not every font supports that. So, how do you compose all of that into one bitmap file and if i wanted to do it my way which is loading a full font file what do you suugest would be the best approach.

Link to comment
Share on other sites

6 hours ago, Sani said:

How do you create your bitmap font ( i know what software you use). I'm using webfontloader.js to load ttf or similar file type. if you need different charecter type for completely different languge like korean, not every font supports that. So, how do you compose all of that into one bitmap file and if i wanted to do it my way which is loading a full font file what do you suugest would be the best approach.

You're right that you have to select the characters you put into your bitmap font carefully. Usually the complete alphabet + numbers is enough to work with, but if you want to also support Korean language, you would have to make a bitmap font that includes any (or all) characters you want to use. I read that the Korean Hangul alphabet has 24 characters, but they are combined to form 140(or so?) characters, sometimes next to each other sometimes above/below each other. So you would have to included all the 140 characters in the bitmap font, I don't think there any way around that. Btw you don't have to put it all in one single bitmap font (latin + korean), you could use separate bitmap fonts and load them both, and then in your program use a variable which holds the bitmap fontname, depending on which language is selected.

The multilanguage in Snake Slider 'only' supports European langauges, so always latin characters. That's why the bitmap font PNG is not very big so I could just use one single bitmap font (per font type). The bitmap font contains any characters used in any of the translations. So it's the alphabet plus certain "special" characters, like ä ç é etc. I use an Excel sheet to hold all the texts, and a VBA macro to export to a JSON file (see example here). I've also added a VBA macro that exports a text file that contains all the unique letter character that are used in all the translations texts. I copy & paste that string as input for the font creation tool.

I used ShoeBox as the font creation tool for Snake Slider. It's a bit tricky to use, not very intuitive I think, but the advantage was that it's freeware, plus you can create the letters in Paint Shop or Photoshop so that gives you some more graphical options. But for example http://kvazars.com/littera/ is also a very good free tool and much easier to use.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...