Account
Menu

Translator





t_hello={
  en="Hello",
  de="Hallo",
  ru="Привет",
  es="Hola",
  it="Ciao",
  fr="Bonjour",
  zh="你好",
}

copied

or in one line:t_hello={en="Hello",de="Hallo",ru="Привет",es="Hola",it="Ciao",fr="Bonjour",zh="你好"}copied
Use:t_hello[_Gg_lang]copied

How to use

Inside your script there will be a global variable _Gg_lang, she will contain the language that the client has chosen:

en - English
de - German
ru - Russian
es - Spanish
it - Italian
fr - French
zh - Chinese

You need to create arrays that will contain texts translated into different languages.

For example, there is an array:

t_house={
  en="house",
  de="Haus",
  ru="дом",
  es="casa",
  it="casa",
  fr="maison",
  zh="房子"
}

To show the client an alert with text in his native language, we will use the function to output text from an array:

gg.alert( t_house[_Gg_lang] )

If the _Gg_lang = "fr", then the client will see maison on the screen


Create your scripts correctly and you will have many grateful clients! 💰