ODW - Multi-Language System Plugin

● ARCHIVED · READ-ONLY
Started by r66r 145 posts Page 1 of 8 View original ↗

  1. Multi-Language System Plugin v1.1.0
    by Open Digital World

    Introduction

    This plugin lets you translate game texts to suit your needs. Texts are simply written in JSON files, grouped in language-specific folders. It is also possible to configure fonts specifically for each language. The active language can be selected from the game options window.

    NOTE: This plugin is a full rewritten and extended version of the Ignis Text Database plugin by Raizen. Also inspired by some features present in the DKTools Localization plugin by DK.

    Features
    • Adds an option to choose the game language.
    • Adds the possibility of having a specific font per language.
    • Translates almost all database and event command texts, including hard-coded texts in RPG Maker MZ code (see comments here).
    • Offers ready-to-use patches for Galv and VisuStella plugins.
    During a game, go to the options to change the language by pressing or simply clicking on the language option. Texts will be translated instantly.

    How to use

    1. Install and configure your plugin. Please note that the first language in the "Languages" settings list will be the default language of the game. You can reorder them as you want in the option box.

    2. Place the font files for your languages in the "fonts" folder at the root of your game project:
    Code:
    RMMZ Project Folder
       |_ Fonts Folder
          |_ Font 0.woff
          |_ Font 1.woff

    3. Create the language folders and files according to your plugin settings, as follows (folder and file names are case sensitive):

    Code:
    RMMZ Project Folder
       |_ Root Folder
          |_ Language Folder => Language [0]
             |_ Language File [0].json
             |_ Language File [1].json
             |_ ...
          |_ Language Folder => Language [1]
             |_ Language File [0].json
             |_ Language File [1].json
             |_ ...

    4. Develop your game, and for each text you want to translate, make sure you follow the correct syntax below:

    => In a text field of the RMMZ editor (database, message, plugin settings):

    ${text code}

    => In a language file (JSON syntax):

    "text code": "text to display"

    => To use the the control characters in translated texts (like color, icon, variable, ...), double escape them like this in the "text to display":

    \C[0] -> \\C[0] or \V[1] -> \\V[1] or \. -> \\.

    => You can also nest translated texts like this in the "text to display":

    "Text1": "an example",
    "Text2": "My text 1 is ${Text1}."

    -> Displayed result = My text is an example.

    5. During a game play, you can change the current active language in the game option window.

    See also README.md for more information about settings, commands, ...

    Terms of use

    This plugin is published under the MIT License.

    Special thanks

    Thanks to @Raizen for allowing me to extend his plugin and to publish a completely reworked version.



    Download Link
    ODW_MultiLanguageSystem.js (itch.io)


    Screenshots
    ODW_MultiLanguageSystem_1.pngODW_MultiLanguageSystem_2.pngODW_MultiLanguageSystem_3.pngODW_MultiLanguageSystem_4.pngODW_MultiLanguageSystem_5.pngODW_MultiLanguageSystem_6.pngODW_MultiLanguageSystem_7.pngODW_MultiLanguageSystem_EN.gifODW_MultiLanguageSystem_FR.gifmls-fonts.gif

    Update Log
    v1.0.0 - 21.10.2021
    • Initial release.
    v1.0.1 - 19.09.2022
    • Fixed a processing bug when the text has the ${} pattern twice or more.
    v1.0.2 - 03.08.2023
    • Fixed a syntax error in the $.updateIndex() function.
    v1.0.3 - 07.09.2023
    • Rewrite the text database load process.
    v1.0.4 - 19.11.2023
    • Revert the changes made in v1.0.3, to load the text database later in the game boot process.
    v1.1.0 - 25.05.2024
    • Improved the documentation.
    • Improved the code for parsing language settings.
    • Added new font settings per language.
    • Added a new global parameter to display/hide the error log in the console.
    • Removed the $.getCodes() and $.getLabels() functions.
    • Removed the $._isDatabaseLoaded property and $.isDatabaseLoaded() function.
    • Removed the compatibility code for VisuStellaMZ plugins (replaced by a patch).
    • Created patch for Galv MZ plugins.
    • Created patch for VisuStella MZ plugins.
  2. Hi, r66r! First, thank you very much for this plugin.

    Does it have any incompatibiity with other plugins? I've been trying to use it, but I get error messages. The game (playtest) doesn't read the JSON. I've checked the script on a JSON checker and it seems it was supposed to work, but it doesn't. I've attached part of the code and also a screenshot of the game.

    When I click "New Game", the message is "Script error" (no more details). Before that, I got a "Couldn't load /languages/en" message, but I noticed the game also tried to load "data/languages/en" so I moved the folder there, and then I got the Script error message. Do you have any idea of what could be happening?

    PS: I'm not a programmer, I just understand the basics (very basic), so I can at least make a JSON file for this plugin. :p But my brother is a programmer and he quickly checked it, he also didn't understand what's happening.

    1651021829040.png1651021844411.png
  3. Hi @pxjk

    First of all, thanks for using this plugin, it's nice to see that it can be useful to someone. :kaopride:

    Reading you and according to the screenshots, I can tell that there could be several problems.

    1. If the texts do not translate, as shown in your screenshot of the main menu, it is probably due to the fact that the text you have configured does not follow the expected format. In other words, you have set "Menu.NewGame" instead of "${Menu.NewGame}" in the plugin settings (since it is a custom menu apparently) or in the RPGMZ editor. But your problem is probably related to the fact that it does not load JSON files, due to points 2 and 3 below.

    What is expected
    1651077897629.png

    2. I don't recommend to set up the "languages" folder in the "data" folder. There can be problems with the functioning of RMMZ. My advice is to put this folder at the root of the project. Then, you have to check that the parameter of the plugin corresponds.
    • Example 1: if my folder is in C:\Dev\MyGame\languages, then the parameter must be "languages".
    • Example 2: if my folder is in C:\Dev\MyGame\external\lang, then the parameter must be "external\lang".
    What is expected
    1651078299205.png
    1651078384178.png

    3. The error message "Couldn't load /languages/en" can be related to several problems:
    • Not all language folders set in the plugin are present in the languages folder.
    • The JSON files of the default active language, or the one configured in the options, are missing.
    In this case, you have to check that the folders per language exist in the "languages" folder. And that these folders contain the expected JSON, even if empty.

    What is expected
    1651078919279.png
    1651078992802.png

    In case of persistent problems, you can consult the console (press F8 or F12 when launching the game) to have the details of the problem with this plugin. I tried to make the debugging information as understandable as possible.

    EXAMPLE
    1651079059261.png

    So don't hesitate to come back to me if you still have problems.
  4. Hi @r66r!

    Thanks a lot for replying! I moved the languages folder back to the root of the game and I re-checked all the JSON files. I think the problem was actually that some of them had a comma right at the final line (I forgot to delete it), like this:

    {
    "example": "exemplo",
    "example2", "exemplo 2",

    }

    Now it's working smoothly! Thank you! :D
  5. Glad it's working now. If you need any further help, I'm still available via this thread.
  6. Very nice plugin.

    Merci pour le partage.
  7. Congratulations on the release
  8. Hi r66r,

    At first thank you very much for your plugin with your efforts. It works well to me to display English texts, however it shows unrecognized text codes when I put Chinese text codes in json files. I guess your plugin does not support Chinese text codes because the text box of RPG maker MZ are able to display the contents I type in Chinese. Could you please have a check or test on it with any random Chinese texts from Google?

    And by the way, is there a way of adding colors to specific texts or phrases?

    Thank you in advance.

    InkedCaptureIssue_LI.jpg
  9. Thanks @r66r,

    I see that you speak french so i permise me that speaking to you in french because it's more easy for me.

    Bonjour,
    Je compte utiliser ce plugin de traduction pour un projet commercial et je souhaiterais créditer la bonne personne.

    Dois-je créditer "Open Digital World" ou une autre personne ?
    Il me semble avoir vu que j'ai le droit d'utiliser le plugin sans restriction gratuite ou commercial.

    Merci d'avance
  10. nemesis99 said:
    Hi r66r,

    At first thank you very much for your plugin with your efforts. It works well to me to display English texts, however it shows unrecognized text codes when I put Chinese text codes in json files. I guess your plugin does not support Chinese text codes because the text box of RPG maker MZ are able to display the contents I type in Chinese. Could you please have a check or test on it with any random Chinese texts from Google?

    And by the way, is there a way of adding colors to specific texts or phrases?

    Thank you in advance.

    View attachment 225811
    Hi. I search for the color too.
    I found a method for apply color on text but i don't know if it's the best.

    I share to you with pictures.

    Capture d’écran 2022-05-11 140214.png
    Capture d’écran 2022-05-11 140247.png
    Capture d’écran 2022-05-11 140336.png
    Have a nice day :wink:

    PS: The text is just for the test. lol


    ----------------
    EDIT: I try chinese from Google too for you and i don't have problem.
    Capture d’écran 2022-05-11 142352.png
  11. Yonah said:
    Hi. I search for the color too.
    I found a method for apply color on text but i don't know if it's the best.

    I share to you with pictures.

    View attachment 225835
    View attachment 225836
    View attachment 225837
    Have a nice day :wink:

    PS: The text is just for the test. lol


    ----------------
    EDIT: I try chinese from Google too for you and i don't have problem.
    View attachment 225838

    Hi Yonah,

    Thank you for your reply. Coloring texts works for me now but unrecognized text issue is still not solved, and your first test text exactly expresses my feeling on this issue. I guess the reason is probably the Language Code in my parameter setting. Could you please point out my mistake in the parameter setting?

    Thank you and enjoy your day too.
    CaptureIssue2.PNG
  12. Hi @nemesis99 and @Yonah

    First of all, thanks for using this plugin and for your feedbacks.

    nemesis99 said:
    At first thank you very much for your plugin with your efforts. It works well to me to display English texts, however it shows unrecognized text codes when I put Chinese text codes in json files. I guess your plugin does not support Chinese text codes because the text box of RPG maker MZ are able to display the contents I type in Chinese. Could you please have a check or test on it with any random Chinese texts from Google?
    This plugin is probably not to blame, as it retrieves the text from the JSON file without transforming it. I did a quick test but had no problem.

    QUICK TEST
    1652283527133.jpeg
    1652283533216.jpeg
    1652283539809.jpeg
    1652283549497.jpeg

    In my opinion, it is a problem of character encoding of the JSON file. Is it in UTF-8 or in another character encoding? The easiest way to check the encoding is to use Notepad++ (or another tool than Windows Notepad), and check what the file encoding is. So let me know if you still have a problem with your JSON file.

    SAMPLE NOTEPAD++
    1652284858502.png

    nemesis99 said:
    I guess the reason is probably the Language Code in my parameter setting. Could you please point out my mistake in the parameter setting?
    The language code in the plugin settings has no influence on the processing of texts. It is useful in the internal functioning of the plugin to load and manage translations. So you can put any value, it should work.

    nemesis99 said:
    And by the way, is there a way of adding colors to specific texts or phrases?
    Yonah said:
    I found a method for apply color on text but i don't know if it's the best.
    The best way to use color in text is to use the basic text box method of the RPG Maker MZ editor (ex. \C[10]), except that you need to put two backslashes instead of one. This method is also valid for all other commands in the text box (e.g. \. \^ \!).

    SAMPLE
    1652285628437.jpeg
    1652284369207.jpeg
    1652284375594.jpeg

    Yonah said:
    Je compte utiliser ce plugin de traduction pour un projet commercial et je souhaiterais créditer la bonne personne.

    Dois-je créditer "Open Digital World" ou une autre personne ?
    Il me semble avoir vu que j'ai le droit d'utiliser le plugin sans restriction gratuite ou commercial.
    Ce plugin étant sous licence MIT, vous pouvez l'utilisez sans autre pour tout type d'utilisation, qu'elle soit personnelle ou commerciale. La seule condition est de ne pas supprimer le bloc "licence" du plugin. Quand à la mention dans les crédits, vous pouvez mentionner "Open Digital World", vu que c'est à travers et au nom de cette "équipe/studio" que je publie mes plugins... et qu'on les retrouves sur itch.io. :D
  13. r66r said:
    Hi @nemesis99 and @Yonah

    First of all, thanks for using this plugin and for your feedbacks.


    This plugin is probably not to blame, as it retrieves the text from the JSON file without transforming it. I did a quick test but had no problem.

    QUICK TEST
    View attachment 225849
    View attachment 225850
    View attachment 225851
    View attachment 225852

    In my opinion, it is a problem of character encoding of the JSON file. Is it in UTF-8 or in another character encoding? The easiest way to check the encoding is to use Notepad++ (or another tool than Windows Notepad), and check what the file encoding is. So let me know if you still have a problem with your JSON file.

    SAMPLE NOTEPAD++
    View attachment 225859


    The language code in the plugin settings has no influence on the processing of texts. It is useful in the internal functioning of the plugin to load and manage translations. So you can put any value, it should work.



    The best way to use color in text is to use the basic text box method of the RPG Maker MZ editor (ex. \C[10]), except that you need to put two backslashes instead of one. This method is also valid for all other commands in the text box (e.g. \. \^ \!).

    SAMPLE
    View attachment 225862
    View attachment 225856
    View attachment 225857


    Ce plugin étant sous licence MIT, vous pouvez l'utilisez sans autre pour tout type d'utilisation, qu'elle soit personnelle ou commerciale. La seule condition est de ne pas supprimer le bloc "licence" du plugin. Quand à la mention dans les crédits, vous pouvez mentionner "Open Digital World", vu que c'est à travers et au nom de cette "équipe/studio" que je publie mes plugins... et qu'on les retrouves sur itch.io. :D
    Thanks so much for your feedback to @nemesis99 because i will to try it but if you think that's just a encoding problem and not a problem from the plugin.

    Thanks for your color method too. I don't know it and it's more easy to use.
    I give the credit to the team then.

    Thanks again for the plugin. :wink::wink:
  14. r66r said:
    Hi @nemesis99 and @Yonah

    First of all, thanks for using this plugin and for your feedbacks.


    This plugin is probably not to blame, as it retrieves the text from the JSON file without transforming it. I did a quick test but had no problem.

    QUICK TEST
    View attachment 225849
    View attachment 225850
    View attachment 225851
    View attachment 225852

    In my opinion, it is a problem of character encoding of the JSON file. Is it in UTF-8 or in another character encoding? The easiest way to check the encoding is to use Notepad++ (or another tool than Windows Notepad), and check what the file encoding is. So let me know if you still have a problem with your JSON file.

    SAMPLE NOTEPAD++
    View attachment 225859


    The language code in the plugin settings has no influence on the processing of texts. It is useful in the internal functioning of the plugin to load and manage translations. So you can put any value, it should work.



    The best way to use color in text is to use the basic text box method of the RPG Maker MZ editor (ex. \C[10]), except that you need to put two backslashes instead of one. This method is also valid for all other commands in the text box (e.g. \. \^ \!).

    SAMPLE
    View attachment 225862
    View attachment 225856
    View attachment 225857


    Ce plugin étant sous licence MIT, vous pouvez l'utilisez sans autre pour tout type d'utilisation, qu'elle soit personnelle ou commerciale. La seule condition est de ne pas supprimer le bloc "licence" du plugin. Quand à la mention dans les crédits, vous pouvez mentionner "Open Digital World", vu que c'est à travers et au nom de cette "équipe/studio" que je publie mes plugins... et qu'on les retrouves sur itch.io. :D

    Thank you both so much @r66r and @Yonah for your kind replies. The final answers are what I expected. I've converted my json file's encoding to UTF-8 then solved, and coloring in json file is definitely handy for me to mark parts from a complete dialogue. Thank you both for your time again.
    Merci.
  15. I do not understand what is supposed to be inserted into the language file.
    this information reads complicated above my understanding atm
    I've got it to change in the settings but when it comes to what is supposed to be inside the language file is beyond me. 4-5 confuzzle me
    4. In each language folders, create as many language files as you need, and declare them in the parameter <Languages -> Language Files>. The name is case sensitive, and the content has to respect the JSON structure.

    5. Develop your game and for each text to translate, use the following form:
    • In the text field of the RMMZ editor: ${<text code>}
    • In the language file: "<text code>": "<text to display in the language>"
    to unravel this mystery for me is a great accomplishment thank you in advance.
  16. Hi @2934c37

    First of all, thanks for using this plugin and for your feedbacks. I will try to clarify these points as best I can. It is true that doing these explanations in the plugin directly without screenshots can be a bit abstract.

    In short:
    • In the language folders, you put your JSON files, in which you will write your texts in the desired language, with the format "TextCode": "Text to display".
    • In the fields of the RPG Maker MZ editor, where you can insert texts (e.g. fields that describe an actor, an object, or the Show Text commands of events), you enter the code of the text to be displayed in the format ${TextCode}.
    In detail
    After creating your project and installing the plugin, you will set the languages. For each language, you need to list the names of the JSON files you will create. By default, the plugin offers only one file (main), but you can add as many as you need.

    1652693273828.png

    After that you can go to the editor to change the texts of actors, objects, etc. and create your sequences in the events.

    1652693376145.png
    1652693838970.png
    1652693516635.png

    Then go to the corresponding JSON files to write the texts in the desired language (here in English, i.e. languages/eng/*.json). Note that the text code on the left must match the one written in the RPG Maker MZ editor, but without ${}. And the text on the right is what will be displayed when you run the game.

    1652693623794.png

    1652693673327.png

    My recommendations are also:
    • to add one file per data type in the database (e.g. actors, objects, weapons, armor, etc.) and as many files as there are maps. This makes debugging easier and allows the translation process to be split into batches.
    • to always work in one language and to do the translations in the other languages afterwards. This allows you to delegate the translation work while optimizing your working time, because texts are often adjusted several times during development... and you might as well do the translation work once the original texts have been validated.
    I hope this will help you in your developments. Feel free to come back here if needed.
  17. TenraiEmiko, Jul 10, 2022

    r66r, can your Multi-Language System plugin support image-based translation?
    Just want to ask it in case I want to use it in my games...
    Thnx!
    Hello @TenraiEmiko,

    For the moment, this plugin doesn't do it natively. But that could be part of an improvement for a future release.

    Note that you can simulate this by using the ShowPicture command and using Script conditions with the functions ODW.MLS.getCurrentIndex() or ODW.MLS.getCurrentCode().
  18. Sorry, Does this plugin support android?
  19. Jufry_A said:
    Sorry, Does this plugin support android?
    This is a good question for which I don't have an exact answer, just a guess, sorry.

    But since this plugin only overwrites existing code in MZ, and uses JSON files for the texts to be translated (same format as MZ database files), I don't see why this plugin wouldn't be compatible with Android if you manage to run MZ on this OS.

    Note that by default, MZ doesn't allow you to deploy a game directly to Android (like MV did), and that the process to create an app is quite tedious, which is why I never did it. :ewink:
  20. Hi r66r thanks a lot for your work!

    I’m using your plugin in my project with:
    GALV_MessageTimerMZ - it works fine,
    GALV_MessageStylesMZ - it doesn’t work.

    If in .json file I write:
    “\\mt[10]Hello World\\pop[0]”,

    or also without MessageTimer:
    “Hello World\\pop[0]”,

    MessageStyle plugin doesn’t work.

    Any ideas?

    EDIT:
    I solved. ^_^

    Put \pop[0] in Text Event not in .json file:
    ${M001.EV001.PG01.TX03}\pop[0]