Hello
@TenraiEmiko
I don't have a demo project (yet) to share with you, but here is some basic information that will be useful. By activating my plugin, you have the ability to configure several settings, including:
- the label to display in the options window (which you can translate directly, as in the screenshot below)
- the name of the folder where you will install the JSON files in the subfolders by language
- the list of languages in your project
In the list of languages, you have several parameters to enter:
- the language code (for reference, but can be used in events via the ODW.MLS.getCurrentCode() function)
- the language label, which will be used in the options window
- the name of the folder that will contain the list of JSON files
- the list of JSON files (without extension)
- various labels that are hardcoded in RMMZ and that can be overloaded here
Spoiler: Languages Settings => Example with English+French
Once my plugin is configured, all you have to do is create the folders and JSON files in your project.
Now, to answer more specifically the question of the functions offered by my plugin:
- ODW.MLS.getCurrentIndex() returns the index of the language in the list (in the above example 0 = English, 1 = French)
- ODW.MLS.getCurrentCode() returns the language code (in the above example 'en' = English, 'fr' = French)
My preference is to use ODW.MLS.getCurrentCode(), which is independent of the order of the languages and remains invariant if the order is changed.
And as a bonus, here is how, thanks to this function, you can easily display images in different languages in your project. As you can see, you just need to use conditions with the script ODW.MLS.getCurrentCode() == '<code>' to then display the image with the corresponding language.
Spoiler: Translated Pictures
Note: I don't plan for the moment to make the display of images dynamic by proposing, for example, to put them in subfolders by language, like for JSON files. Maybe in a future major release.
I hope this answers your questions. And if needed, don't hesitate to contact me in PM to specify your need.