- Joined
- Apr 9, 2015
- Messages
- 1,812
- Reaction score
- 895
- First Language
- German
- Primarily Uses
- RMMZ
Core plugin
Menu plugin
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
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:
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:
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.
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" }}
Code:
{ "text": ["Text 1", "Text 2", "Text 3"]}
{ "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.
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.
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.
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: