HeroEngine Forums

HeroEngine Support => Scripting & Programming => Topic started by: Acinus on Sep 04, 12, 05:36:26 AM

Title: [Resolved] Multi language management
Post by: Acinus on Sep 04, 12, 05:36:26 AM
Hello all,

We would like to offer many languages inside our world. So we are thinking about the best way to manage different languages in the GUI.

We did not saw any advice on this subject on the Wiki, may be one of you already did that, or have an idea how to manage that  ?


P.S. For the start we plan 2 languages : Fr and En, but in the future we plan to have 5, so our system need to be able to include more languges later.

Thanks for any help

Zal
Title: Re: Multi language management
Post by: Arlohian on Sep 04, 12, 06:30:37 AM
I guess you could just place some kind of a universal translate function and use it when displaying any text. Could easily manage infinite ammounts of languages as long as your translator works well.

Example
(havnt actualy tested/compiled it, just coding it right here on the forum :)))
Code: [Select]
method SetUpText()
  label as noderef of class GUILabel = findguicontrolbyname(0, something.something._label
  label.text = somescript::translate_text("Hello world")
.

// or proably an external function... pretty sure there are some libraries for c++ that could auto translate stuff.
shared function translate_text(text as string) as string
  translated_text as string

  // get language from settings
   translated_text  = ...// translate stuff to the language
 return translated_text
.

Title: Re: Multi language management
Post by: Acinus on Sep 04, 12, 06:53:40 AM
Thanks for the tip.

How do you think is the best way to save all texts ? As we will have a lot of texts in different languages, how is the best way to save this amount of data in HE ?
Title: Re: Multi language management
Post by: HE-HERB on Sep 04, 12, 06:56:42 AM
Have you checked out the localization page on the wiki?

Cheers
Title: Re: Multi language management
Post by: PN-Dwight on Sep 04, 12, 07:05:34 AM
more cumbersome would be that you have an enum for the player defining all languages possible (so it can be set in options) and have your labels and text-fields called depending on that enumeration.

It's a LOT of work, and will make your scripts a lot longer :P
Title: Re: Multi language management
Post by: Acinus on Sep 04, 12, 02:30:34 PM
Guys thanks a lot, you really helped.

Lot of informations are in "Localization" in wiki, simply i didn't know it was their.

Thanks

Zal