Status
Not open for further replies.

Iavra

Veteran
Veteran
Joined
Apr 9, 2015
Messages
1,797
Reaction score
865
First Language
German
Primarily Uses
Core plugin

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}.jsonHow to UseTo 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:
Code:
{    "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:
Code:
{    "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:

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.
Menu plugin

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:EnglishHow to UseSimply 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.
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
 
Last edited by a moderator:

Makeratore

Veteran
Veteran
Joined
Feb 9, 2014
Messages
214
Reaction score
71
First Language
Italian
Primarily Uses
RMMZ
Can we use this also to translate EVERYTHING like plugin entries? For example, maybe there is a plugin that allow you to have custom messages or text for something. And inside of that plugin maybe there are a lot of terms. Can we translate them? Also, does it work for database, messages, map name, everything? I'm telling you these things because I used a script for Ace that made the user able to translate everything replacing them with a code. Then, in the external file, you can refer to that code and write your translation for every term with different codes.
 

Iavra

Veteran
Veteran
Joined
Apr 9, 2015
Messages
1,797
Reaction score
865
First Language
German
Primarily Uses
A complete list of what the plugin works for:

Code:
gameTitlecurrencyUnitterms (basic, params, commands, messages)actors (name, nickname, profile)classes (name)skills (name, description, message1, message2)items (name, description)weapons (name, description)armors (name, description)enemies (name)states (name, message1, message2, message3, message4)elementsskillTypesweaponTypesarmorTypesequipTypesmessage windows / choices
It also supports custom categories, that you can access like this:
Code:
TextManager._text(category, key);
 
Last edited by a moderator:

Makeratore

Veteran
Veteran
Joined
Feb 9, 2014
Messages
214
Reaction score
71
First Language
Italian
Primarily Uses
RMMZ
Ok, thanks. But it won't support for other things like the ones I mentioned?
 

Iavra

Veteran
Veteran
Joined
Apr 9, 2015
Messages
1,797
Reaction score
865
First Language
German
Primarily Uses
Well, if you have a hardcoded string (or one retrieved via parameter) in some other plugin, it won't magically replace it, no.
 
Last edited by a moderator:

Makeratore

Veteran
Veteran
Joined
Feb 9, 2014
Messages
214
Reaction score
71
First Language
Italian
Primarily Uses
RMMZ
Ok, thank you for the answer!
 

saronpasu

Villager
Member
Joined
Apr 6, 2012
Messages
26
Reaction score
32
First Language
Japanese
Primarily Uses
hi.

i am use this plugin.

this plugin very powerful !!

but, this case not switch language.

test event case_A

capture0001.png
case_A result

capture0002.png
test event case_B

capture0003.png
case_B result

capture0004.png
Window_NameInput, reference $gameSystem.locale.

And, Game_Troop.prototype.makeletterTable then reference $gameSystem.isCJK();

NameInput and Troop letterTable can switch language this plugin?
 

Iavra

Veteran
Veteran
Joined
Apr 9, 2015
Messages
1,797
Reaction score
865
First Language
German
Primarily Uses
I see, the input buttons are hardcoded in Window_NameInput and not read from $dataSystem. But since multiple languages use the same letters, it's probably better to have them separate from this plugin (i actually haven't thought of non-latin languages when i made this...).
 
Last edited by a moderator:

q8fft3

Veteran
Veteran
Joined
Aug 17, 2014
Messages
82
Reaction score
7
First Language
arabic
Primarily Uses
can any one give demo , i try to understand but i miss ? help.
 

Shiroi Akuma

Shut up and take my Monet    ( ͡° ͜ʖ ͡°)
Veteran
Joined
May 11, 2015
Messages
350
Reaction score
282
First Language
German
Primarily Uses
N/A
@q8fft3 first you need to copy the plugin in the plugin folder edit: the name doesn't matter, then in game you create an event with a script call as content. Insert only

IAVRA.I18N.exportJson(), As soon you activate the event somehow a Dialog with all in game Text open. Oh, I have to work, will write more later.... or better: Edit this post. D:
 
Last edited by a moderator:

Iavra

Veteran
Veteran
Joined
Apr 9, 2015
Messages
1,797
Reaction score
865
First Language
German
Primarily Uses
The plugin name shouldn't actually matter, since i don't rely on the PluginManager to retrieve my parameters.
 

q8fft3

Veteran
Veteran
Joined
Aug 17, 2014
Messages
82
Reaction score
7
First Language
arabic
Primarily Uses
The plugin name shouldn't actually matter, since i don't rely on the PluginManager to retrieve my parameters.
I used the plugin is amazing, but is to bad for arabic users don't supporting Special characters "unicode" in Windows_msssage.
 
Last edited by a moderator:

Shiroi Akuma

Shut up and take my Monet    ( ͡° ͜ʖ ͡°)
Veteran
Joined
May 11, 2015
Messages
350
Reaction score
282
First Language
German
Primarily Uses
N/A
Will export for show text entries also come? I noticed that no dialogue from "show text" has been exported. Aren't those the message windows?
 
Last edited by a moderator:

Lee Sang

Sang Hendrix
Veteran
Joined
Jun 7, 2012
Messages
132
Reaction score
217
First Language
Vietnamese
Primarily Uses
RMMV
I love the plugin, but is there anyway to write multi lines of text without getting "Uncaxsytax Error: Unexpected Token" error?

I have an example here. 

7pajI6N.png
 

Iavra

Veteran
Veteran
Joined
Apr 9, 2015
Messages
1,797
Reaction score
865
First Language
German
Primarily Uses
Sadly, JSON doesn't support real linebreaks in Strings. You'll need to replace those with "\n".

Will export for show text entries also come? I noticed that no dialogue from "show text" has been exported. Aren't those the message windows?
I opted not to do this, since it would require me to browse through all events, common events and battle events in the game and is rather tedious to do. Personally, i think it's better to plan your game with multiple languages in mind, than to re-localize it afterwards, anyway.
 
Last edited by a moderator:

Shiroi Akuma

Shut up and take my Monet    ( ͡° ͜ʖ ͡°)
Veteran
Joined
May 11, 2015
Messages
350
Reaction score
282
First Language
German
Primarily Uses
N/A
I planned, but so far the only solution is to work with conditional branches to let the player choose which language he would like, however that far too much work and the events get too confusing with many conditional branches. In combination your plugin would at least localize the menus. I guess I have to wait then for a multilanguage plugin, or hire someone. Anyways thank you. :)
 

Iavra

Veteran
Veteran
Joined
Apr 9, 2015
Messages
1,797
Reaction score
865
First Language
German
Primarily Uses
Oh, but it can localize your messages, it just won't export the existing ones.

Say your language file contains this entry:

Code:
{    // ...other stuff    "text" : {        "myText" : "lalala"    }}
The you could use \:[myText] inside "Show Text..." to import that entry.
 

Shiroi Akuma

Shut up and take my Monet    ( ͡° ͜ʖ ͡°)
Veteran
Joined
May 11, 2015
Messages
350
Reaction score
282
First Language
German
Primarily Uses
N/A
It's not 100% comfy without export, because I would need to write the text in the 1st and 2nd language + using the escape codes in the editor, instead of just rewriting the text in the file(s), but I think I like this solution too, thanks! :)  
 

Densetsustudio

Villager
Member
Joined
Oct 24, 2015
Messages
7
Reaction score
1
First Language
german
Primarily Uses
does not work with japanese language.. if you could add this and maybe be able to export and translate the show text message than this would be golden!
 

Iavra

Veteran
Veteran
Joined
Apr 9, 2015
Messages
1,797
Reaction score
865
First Language
German
Primarily Uses
I probably won't add Show Text export for now.


How exactly does japanese not work? Does it work normally, without using this plugin?
 
Status
Not open for further replies.

Latest Threads

Latest Profile Posts

AeroPergold wrote on LUKElcs's profile.
Its-a me, Pergold from Gamejolt!
I added footstep sounds to our content that I posted in a previous thread. I was unable to edit the post, so if you're interested, see below.

DOWNLOAD LINK

I've started working on rpg maker again, and I can see a lot of improvement from when I was 13. I still have a long way to go, but I'm proud that I've gotten this far.
Animated Title screen is by SharkerrBlue(SB)
I am using the Nightmare Land pack.
I just can't walk to the store for lunch without walking past people smoking. It not only smells bad, it's probably poisoning me. I'm afraid I'll eventually have to be hospitalized. I can't take another path because there's too much traffic and drivers in the plaza are reckless sometimes. I almost got run over once, even after looking both ways.
RyanYe wrote on whtdragon's profile.
Your art works about Wyrvens and Dragons are sooooooooo cooooooooool~! I like them so bad
Can you create more? like Archangels, Devils, Titans, Cyclops!!

Forum statistics

Threads
108,811
Messages
1,039,654
Members
141,257
Latest member
GoUrbex
Top