Note: Refer to the following posts for a detailed description of all subplugins belonging to this one. Author Iavra Terms of Use Free to use for both commercial and non-commercial games. Please give credit. Download Core: http://pastebin.com/DQjGF7DC Menu: http://pastebin.com/zLjzkeei
IAVRA.I18N.language; Returns the current language. IAVRA.I18N.language = lang; Sets the current language to lang. IAVRA.I18N.languages(); Returns a list of all available languages. IAVRA.I18N.localize(text); Localizes the given text. Plugin Iavra Localization - Core Description The core plugin for localization, which contains all logic to load text and convert escape codes. Parameters @param Escape Code @desc Code, that will be used to retrieve localized strings. "{key}" serves as placeholder for the text key. @default #{{key}} @param Languages @desc Comma-separated list of languages, that should be supported. The first entry will be used as the default. @default en @param File Path @desc Path to the language files to load. The sequence "{lang}" will be replaced with the languages entered above. @default {lang}.json How to Use To setup this plugin, register all supported languages inside the "Languages" parameter, separated by commas. You also need to place the corresponding files inside your project folder. So, for example, if you want to support the languages "en" (english) and "de" (german) and the parameter "File Path" is set to its default value, you'll need to add the two files "de.json" and "en.json" to the root folder of your project. The first language will automatically used as the default langage. During runtime, every instance of "#{...}" (can be changed via plugin parameter "Escape Code") will get replaced with a localized string, where "..." stands for a text key. So, if your language file looks like this: { "text.test": "This is a test text" } Every instance of "#{text.test}" will be replaced with "This is a test text". For better maintainability, it's also possible to split keys at dots: { "text": { "test": "This is a test text" } } The above example will result in the same key as the first one, but makes it easier to construct nested keys, for example for the names of all actors. Instead of objects, you can also use arrays, like this: { "text": [ "Text 1", "Text 2", "Text 3" ] } This will create the keys "text.0", "text.1" and "text.2", each pointing to the text listed at that array index. If needed, you are free to combine the object and array notations. Keys can also contain keys themselves, which will be replaced recursively. This allows you, to define important strings, like city names, at a single position and reference it everywhere else: { "text": "Hi, my name is #{actor}", "actor": "Harold" } You can use all escape characters, like "\V[...]" inside the files, but will need to double the backslashes. Line breaks can be entered by using "\n", since JSON doesn't support real linebreaks inside strings. The plugin offers the following script calls: Code: IAVRA.I18N.language; Returns the current language. IAVRA.I18N.language = lang; Sets the current language to lang. IAVRA.I18N.languages(); Returns a list of all available languages. IAVRA.I18N.localize(text); Localizes the given text.
Plugin Iavra Localization - Menu Description Adds a "Language" option to the options menu, that can be used to change game language on the fly. Parameters @param Option Label @desc Label to be used for the option in the options menu. @default Language @param Language Labels @desc Comma-separated list of "language:label" pairs, to be used for the language selection. @default en:English How to Use Simply place this plugin in your plugin list after "Iavra Localization - Core". The parameters "Option Label" and "Language Labels" are used to define the text to be shown. You are free to use escape codes inside those parameters, as well, though i recommend against localizing the language labels.
Can you provide a very small demo with 2 or 3 sample languages? I'm trying to use these plugins, but I don't understand well how to use them properly. EDIT: Sorry, I think that I've figured out how the plugins work. Thanks anyway!
I created a small demo and linked it in the OP (didn't translate everything, but it should give a general idea). I don't have a personal webspace, so i picked a random freehoster... A small note, that i forgot to mention before: If your plugin contains special characters (for example german ä, ö, ü, ß), you should save the language files in UTF-8 (Notepad++ can do this, for example). Otherwise, the characters won't get displayed correctly.
Hey so this is a fantastic plug-in thank you! I downloaded the demo.dem but I'm not sure how to actually play it haha. How do I open the .dem file?
Something seems to have gone wrong, while uploading the demo :/ I don't have it anymore, since i switched to a new computer since i made this plugin. The plugin shouldn't actually be too hard to use, though.
EDIT¹: Managed to figure out how to write the json files. But I've read in the development threat that is possible to use the keys on plugins, anyone knows if it's possible and how to do it? EDIT²: Also, anyone knows if it's possible to make buttons text from plugins to change with this one?
The plugin replaces keys, when text is written on a window or bitmap. So, as long as the plugin displays its text via one of these options, it will be translated.
Thanks for the quick answer. The problem was that I tried to use that "\\:[key]" formart that was used in the development thread. Traded it for the "#{key}" format and now it's working fine. You really saved my skin because I need to use this for my college course work.
Greetings. I am using your plugin in my project, and it is working fine. However, when I use "Change Name" event, it shows #{(my_variables)} instead of char name (I am storing some char names in .json files because the names change as the language). How can I solve this? Temporarily I created a menu when the player choose the default char name or input a new name (first it blanks the char name then call change name screen). Thank you very much!
I see...Window_NameEdit draws the actor name 1 character at a time, so it won't get replaced with the actual text. For now i don't have the time to fix it, but i'll see what i can do when i get to rewrite the plugin.
I decided, that i won't support the input name scene out of the box. It won't be able to coexist together with games, that want to localize their character names, so i have to decide to go follow one of those routes. You can use the following snippet to resolve the character name prior to calling the scene: Code: (function($) { var alias_initialize = $.prototype.initialize; $.prototype.initialize = function(actor, maxLength) { actor._name = IAVRA.I18N.localize(actor._name); alias_initialize.call(this, actor, maxLength); } })(Window_NameEdit)
Thank you for an interesting plugin. It is very sad that there is no exporter / importer functions. When you planning to add this?
Thank you! Very nice! found out that I can just use comma(,) on each text line and add words to create new lines. my question is... for a really long sentence- is there a way to put half of it under it? (pressing space in normal editing.) thank you, I hope for your reply.
Thanks fort the great plugin. Very versatile. I just would like to add that Windows Defender has been giving false positive for Trojan:Win32/Spursint.A!cl on both scripts.