Sponsored By

Creation of a Point & Click screen - PART 3 : The translations

Some "behind the scenes" on the creation of a room in Demetrios! Here we study how to code translations!

Fabrice Breton, Blogger

November 6, 2015

8 Min Read

In this new part, I'm going to focus on integrating text, and more precisely : the translations!

Hotspots

Hotspots

 

Last time, we've seen that hotspots on the screen have a label associated. But in the game program, this label isn't an english text. Instead, it is an ID (identifier).

For example : PC16_REEDS for the reeds hotspot.

Why? Why not putting english directly into the game code?

The answer is : to be able to do translations. Separating the game code and the text itself is much better because the whole text will be contained in a file, ready to be translated by a third party.

When it comes to programming, this is good practice : the more you separate each aspect of the software, the better! (I admit not pushing this to an extreme though, as doing it would make the development process a lot longer)

For Demetrios, all the text is located into raw text files, and these files have several versions : one by language.

In the English text file, here's what you'll find :

PC16_REEDS=Reeds

In the French text file, you'll find :

PC16_REEDS=Roseaux

And so on! Simple as that!

This way, translating is very easy : just open the raw text file and translate the words, line by line. The ID is the link with the program itself!

Based on the ID, the code searches through the current language text file, retrieves the translation and displays it!

The same applies to dialogs and interactions in the game, which also have IDs (one separate ID by speech).

For example :

PC01_TOPLEFTDOOR_UNLOCKED_IDCARD-1=This is no place to put an ID card!

PC01_TOPLEFTDOOR_UNLOCKED_IDCARD-2=It's much better to leave it in some random pocket of a random jacket.

Dialogs had a black background like Gabriel Knight 1

The old version of my game didn't have any translation. Only French!

Don't make that same mistake, plan a translation system from the beginning!

 

In the next and final part, we'll talk about the game dialogs engine!

Aside this, some news on the development!

As I'm now developing the later chapters of the game, I'm careful about what I can show. I wouldn't want to spoil the surprises!

However, I couldn't resist showing you a screenshot from the latest room I've done a few days ago!

Work in progress!

Work in progress!

 

My Kickstarter finishes in less than one day! Be sure to support it if you're interested!

https://www.kickstarter.com/projects/983902887/demetrios/

 

Read more about:

2015Blogs
Daily news, dev blogs, and stories from Game Developer straight to your inbox

You May Also Like