Editor icon indicating copy to clipboard operation
Editor copied to clipboard

Editor with language choice

Open dad72 opened this issue 6 years ago • 8 comments

Hi Julien,

It would be nice to be able to put the editor in another language (In French).

The idea is to make a separate file that stores all the texts. So to add other languages, it would be enough to edit this file (Json for example) to give it a name of the country (French.lang.js, English.lang.js ...) The editor would load to automatically list all the existing language files. Then in the editor menu select the desired language from those available.

What do you think of this idea ?

dad72 avatar Jun 15 '19 12:06 dad72

Hey! Sure it is an excellent idea. This is already asked here: https://github.com/BabylonJS/Editor/issues/128

I’m keeping this issue opened and will close the other as this one is more complete :)

Will start on it once thé 3.1.2 is released :)

julien-moreau avatar Jun 15 '19 12:06 julien-moreau

I did not pay attention that this had already been asked. I have been to see and see that this has resulted in the creation of clear and dark theme. The dark theme is really pretty. The editor has evolved since the beginning when I saw it. Good luck Julien and great job, I am impressed by all that has been done and I know all the work that represents an editor.

dad72 avatar Jun 15 '19 12:06 dad72

Oh! when it happens a can help translate it to Russian

coldestheart avatar Jun 25 '19 08:06 coldestheart

@dad72 are you interested to contribute to it ? Using i18next would do well the job :)

julien-moreau avatar Jun 01 '20 21:06 julien-moreau

I don't know if I'm going to have a lot of time to get it done in a reasonable amount of time. what i18next is ?

dad72 avatar Jun 02 '20 00:06 dad72

I did research on i18next to find out what it is. Sounds good, but have never learned to use it.

My ways I did it on my projects :

  • A json file containing the languages -- "Menu": { "file": { "createProjet" : "Créer un projet", }} -- I then replace in the editor all the key words. Menu.file.createProjet
  • A GUI submenu which lists the available languages ​​(generally used PHP which is more direct)
  • I saved the user's choice of language in a cookies either in JS or in PHP
  • When the user chooses a language, I reloaded the editor.

dad72 avatar Jun 02 '20 11:06 dad72

Excellent, excactly what I though Using i18next allows to manage plural, data merging etc.

So instead of myText = menu.file.createProject it would be i18n.t("menu.file.createProject")

Will do that once the basics of the editor are done and stable then :)

julien-moreau avatar Jun 02 '20 13:06 julien-moreau

If you put the basics in the editor by making the English Json file, I could help to make the file in French eventually. Unfortunately, I don't have a lot of knowledge about the architecture of your editor in its sources. But i would gladly help later

dad72 avatar Jun 02 '20 14:06 dad72