Localization - Translate your projects into several languages

DK

Veteran
Veteran
Joined
Mar 30, 2016
Messages
396
Reaction score
375
First Language
Russian
Primarily Uses
RMMZ
Author: DKPlugins
Version: 5.5.6
Description: Localization of game. Translate your project into several languages.

Requirements and dependencies:
  1. Availability of working plugin DKTools version 11.2.4 or above
Features:
  1. Unlimited number of languages
  2. Ability to use different audio/image resources for different languages
  3. Use the tags {} to localize a text
  4. The text localization is stored in the locales folder
  5. Unlimited number of localization files
  6. Works on all platforms! PC, mobile phones, browsers!
  7. You can translate any parameters of other plugins
  8. Saving untranslated tags to a separate file using the plugin command will help you not to forget about something important
  9. 2 customizable language selection screens
  10. Change of language through options, title screen
  11. No need to restart the game to change the language. Everything changes instantly

Screenshots:
ShooterScreenshot-58-26-06-20.png
ShooterScreenshot-60-26-06-20.png
ShooterScreenshot-59-26-06-20.png
ShooterScreenshot-74-14-08-20.png
ShooterScreenshot-73-14-08-20.png

How to add the option to YEP_OptionsCore:
  • Place YEP_OptionsCore plugin ABOVE in the plugin list
  • Enable the Show Options Command parameter in the settings of the localization plugin!
  • Configure the new option in YEP_OptionsCore.js with following parameters:
  • Symbol: locale
  • Show/Hide:
    JavaScript:
    show = LocalizationParam.get('Show Options Command');
  • Draw Option Code:
    JavaScript:
    var rect = this.itemRectForText(index);var statusWidth = this.statusWidth();
    var titleWidth = rect.width - statusWidth;
    this.resetTextColor();
    this.changePaintOpacity(this.isCommandEnabled(index));
    this.drawOptionsName(index);
    this.drawText(this.statusText(index), titleWidth, rect.y, statusWidth, 'center');

Plugin commands:
  • UpdateLocalizationTags - Checks json files from "data/" except ignored files specified in the plugin parameters and also all the parameters of all plugins. Found tags are saved in new files in the localization folder with the prefix "new".
  • ClearLocalizationCache - Clears the localization cache.

Script calls:
  • DKTools.Localization.locale - Get current locale
  • DKTools.Localization.locales - Get an array of locales
  • DKTools.Localization.language - Get current language
  • DKTools.Localization.languages - Get an array of languages
  • DKTools.Localization.getText(text) - Get localized text
  • DKTools.Localization.getPrevLocale() - Get previous locale
  • DKTools.Localization.getNextLocale() - Get next locale
  • DKTools.Localization.getPrevLanguage() - Get previous language
  • DKTools.Localization.getNextLanguage() - Get next language
  • DKTools.Localization.locale = 'en' - Set "en" locale
  • DKTools.Localization.selectPrevLocale() - Select previous locale (async, returns Promise)
  • DKTools.Localization.selectNextLocale() - Select next locale (async, returns Promise)
  • DKTools.Localization.addChangeLocaleListener(function) - Add "change locale listener"

Help:
###===========================================================================
## Special compatibility with other plugins
###===========================================================================
The plugin is compatible with most other plugins,
but plugins that do not work with localization can still be included.
I add the compatibility of these plugins. For compatibility to work properly,
plugins from the following list must be placed ABOVE the localization plugin:
YEP_MessageCore.js
YEP_OptionsCore.js
YEP_QuestJournal.js

## Attention! ##
If you think that any plugin is not compatible with localization, let me know.

###===========================================================================
## Used formats
###===========================================================================
The following formats can be used for translations:
1. JSON (details: https://en.wikipedia.org/wiki/JSON)

###===========================================================================
## Instructions
###===========================================================================

### 1 ### Installation ###
1. Add at least one language in the "Game languages" parameter.
2. If you changed the standard font in the game, you also need to change it in the "Standard Font" parameter.

## Incomplete list of recommended locales ##
Russian - ru
Ukrainian - uk
Belarusian - be
English - en
Chinese - zh
Japanese - ja
Korean - ko
French - fe
German - de
Spanish - es
Czech - cs
Italian - it

If you did not find a locale in this list, you can find it on the Internet, for example,
here: https://www.science.co.il/language/Locale-codes.php

### 2 ### Usage ###
1. When you first start the game, the plugin will create a folders for translations and json files for each language.
2. To localize text use the tags: {}.
3. To use a variable inside text use the tag: \VAR[ID],
where ID is the number of the variable. Use only for depth of translation (see below).

### Adding a new translation with an example of an event with a message ###
1. Create a new event, add a message display.
2. In the message, write {text}. Save the event and project.
3. Open json files for each language.
4. The first character of the file must be {, and the last one - }.
These characters can not be deleted. Inside these brackets the translation of the game is written.
6. Add the following text to one of the files and save it: "text": "Text".
7. Start the game and the created event.

### Attention! ###
The encoding in the translation files must be UTF-8 without BOM.
I recommend using Notepad++ to edit localization files.

###===========================================================================
## Using arrays
###===========================================================================
Arrays are loaded into the localization data by file name.

### Using arrays with the "quests.json" file as an example ###
1. The file has the following structure:
[null, { "name": "Quest 1" }, { "name": "Quest 2" }]
2. To display the text "Quest 1" in a message, you need to write a tag
{quests[1].name}
To access the array, you must first write the file name,
in which it is stored, then it must be indicated in square brackets
the element number and the field to be used.

###===========================================================================
## Localized resources
## Using different files (audio, images and videos) for each language
###===========================================================================
This function will help to use special files for different languages.
For example, if there is text on pictures, then you can make different pictures for each language,
and the plugin itself will select the desired picture.
This function works only with audio, video and images.

## Attention! ##
For this function to work on mobile devices and browsers,
you must set the Nwjs + Stamp file system mode in the DKTools plugin!

1. Create a new folder in your images folder
2. Use the required game locale as the folder name
3. Move the files to the created folder
Example:
It is necessary to use different images from the "img/pictures" folder for different languages.
Leave the image for the main (for example, English) language in the "img/pictures" folder.
Create an "ru" folder under "img/pictures" and move the image for Russian language there.
For example, for the English language, the main file from "img/pictures" will be used,
and for Russian from the folder "img/pictures/ru" we created.

## Attention! ##
Before publishing a game for browsers or mobile devices,
run the DKTools plugin command UpdateFileSystemStamp to update
file system stamp (more details in the DKTools plugin help)!

###===========================================================================
## Using an unlimited number of translation files
###===========================================================================
## Attention! ##
For this function to work on mobile devices and browsers,
you must set the Nwjs + Stamp file system mode in the DKTools plugin!
This instruction is intended for the folder that has a default name (locales)
If you renamed the folder in the plugin settings, then use the new folder name!

If you have a large amount of text in the game, and you are not comfortable using one json file,
then you can split it into several json files and put it in a separate folder.
Example for English locale (en):
1. In the locales folder, create an "en" folder.
2. Transfer your old en.json file from the locales folder to the new folder.
3. Create several json files with any names.
4. In each file, write down the required tags and save the changes.
## Attention! ##
All tags in all files must have a unique name!
If the tag names match, the first one will be loaded (order is not guaranteed)!

### 3 ### Plugin parameters ###
1. Ignored files - Files that are ignored by the UpdateLocalizationTags and ExportAllText plugin commands.
2. Parse Depth - The number of text translation operations.
In the translated text you can specify another tag,
and it will be translated if the depth of translation is greater than 1.
Example:
"text": "Text {text2}",
"text2" "2"
With a translation depth of more than 1, the result is "Text 2".
3. Text Length - The length of the text at which it is saved in the cache.
This is necessary to reduce the computational resources for translation.
The cache is automatically cleared when between maps.

### 4 ### Message special symbols ###
1. \language - Display the name of the current language

### 5 ### Plugin commands ###
1. Extracts untranslated tags: UpdateLocalizationTags
The plugin command checks json files from "data/"
except ignored files specified in the plugin parameters
and also all the parameters of all plugins.
Found tags that are missing in the localization folder,
saved to a new files in the localization folder with the prefix "new".

2. Clear the localization cache: ClearLocalizationCache

3. Export all text: ExportAllText IGNORE_TAGS
IGNORE_TAGS - Ignore localization tags ? true/false
The plugin command checks json files from "data/"
except ignored files specified in the plugin parameters
and also all the parameters of all plugins.
The found text are saved to the export.txt file in the localization folder.
Unlike the UpdateLocalizationTags command, it stores all text, not just tags.

### 6 ### Script calls ###
1. DKTools.Localization.locale - Get current locale
2. DKTools.Localization.locales - Get an array of locales
3. DKTools.Localization.language - Get current language
4. DKTools.Localization.languages - Get an array of languages
5. DKTools.Localization.getText(text) - Get localized text
6. DKTools.Localization.getPrevLocale() - Get previous locale
7. DKTools.Localization.getNextLocale() - Get next locale
8. DKTools.Localization.getPrevLanguage() - Get previous language
9. DKTools.Localization.getNextLanguage() - Get next language
10. DKTools.Localization.selectLocale(locale) - Set locale (async, returns Promise)
11. DKTools.Localization.selectPrevLocale() - Select previous locale (async, returns Promise)
12. DKTools.Localization.selectNextLocale() - Select next locale (async, returns Promise)
13. DKTools.Localization.addChangeLocaleListener(function) - Add "change locale listener" (sync/async function)
14. DKTools.Localization.getPrimaryLocale() - Get primary locale
15. DKTools.Localization.getPrimaryLanguage() - Get primary language

### 7 ### How to add the option to YEP_OptionsCore.js ###
1. Place YEP_OptionsCore plugin ABOVE in the plugin list
2. Enable "Show Options Command" parameter in the Localization plugin
3. Configure the new option in YEP_OptionsCore.js with following parameters:
Symbol: locale
Show/Hide:
show = LocalizationParam.get('Show Options Command');
Draw Option Code:
var rect = this.itemRectForText(index);
var statusWidth = this.statusWidth();
var titleWidth = rect.width - statusWidth;
this.resetTextColor();
this.changePaintOpacity(this.isCommandEnabled(index));
this.drawOptionsName(index);
this.drawText(this.statusText(index), titleWidth, rect.y, statusWidth, 'center');

### 8 ### Run on mobile devices and browsers ###
1. Make sure you have Nwjs + Stamp filesystem mode enabled in the DKTools plugin.
2. Before compiling the project, you must run the plugin command UpdateFileSystemStamp
from the DKTools plugin.
3. Compile the project for the required platform.
A description of the filesystem modes can be found in the DKTools plugin help.

### 9 ### Language switcher in messages ###
The function is designed to check messages in different languages.
To open the switcher window, use the configured key in the plugin parameters.
Default: T
The switcher does not work when entering numbers, selecting an item,
and the function may not work correctly if some plugins strongly change the message system.

I strongly recommend that you try the demo version before asking questions

Terms of use

You can:
-To use the plugin for your non-commercial projects
-Change code of the plugin

You cannot:
-Delete or change any information about the plugin
-Distribute the plugin and its modifications

Details on obtaining a commercial license on my website

MZ version:
https://forums.rpgmakerweb.com/inde...e-your-project-into-several-languages.126316/

Download: https://dk-plugins.ru/mv/system/localization/
 
Last edited:

DK

Veteran
Veteran
Joined
Mar 30, 2016
Messages
396
Reaction score
375
First Language
Russian
Primarily Uses
RMMZ
Version 3.0

1. Added support for browsers and mobile devices
2. Added a new option: Using new files to save updated tags
 

DK

Veteran
Veteran
Joined
Mar 30, 2016
Messages
396
Reaction score
375
First Language
Russian
Primarily Uses
RMMZ
Version 3.1

1. Added compatibility with DKTools 6.1+
2. Fixed a bug with DKTools.Localization.addChangeLocaleListener

Version 3.11
1. Fixed a bug with loading a locale

Updated first post and demo.
 
Last edited:

Archeia

Level 99 Demi-fiend
Staff member
Developer
Joined
Mar 1, 2012
Messages
15,677
Reaction score
16,448
First Language
Filipino
Primarily Uses
RMMZ
I really like how it includes the database for translation! The only thing I highly dislike about it is everything is in a single json file. I'm testing out if I can work with it with my own dialogue only localization script. Thanks very much for the high quality plugin :3
 

DK

Veteran
Veteran
Joined
Mar 30, 2016
Messages
396
Reaction score
375
First Language
Russian
Primarily Uses
RMMZ
I really like how it includes the database for translation! The only thing I highly dislike about it is everything is in a single json file. I'm testing out if I can work with it with my own dialogue only localization script. Thanks very much for the high quality plugin :3
Glad you like the plugin.
I think that in the next version of the plugin I will add the ability to use an unlimited number of JSON files in the localization folder for one language.
 

DK

Veteran
Veteran
Joined
Mar 30, 2016
Messages
396
Reaction score
375
First Language
Russian
Primarily Uses
RMMZ
Version 4.0

What's new:
1. Added the function of splitting the translation into several json files (only for PC).
2. If the json file has the wrong structure, then the game now does not hang, but gives an error, and shows where it was made.
3. Removed the setting for using new files to update localization tags. Now new tags are always saves to new files.
4. "UpdateLocalizationTags" command is out of beta version. Added support for parsing all active plugins. That is, the plugin team pulls tags from the settings of all plugins.
5. More compatibility with other plugins.
6. Added 1 special character for messages. Now you can display the name of the current language in the message.
7. Updated help file.
8. Updated demo. Added new examples.

P.S. Please note that the latest version of the plugin requires the latest (currently) version of the DKTools plugin - 7.0.0.
 

WickedWolfy

Touch Fluffy Tail!
Veteran
Joined
Nov 27, 2017
Messages
115
Reaction score
51
First Language
En
Primarily Uses
RMMZ
Have not used the plugin yet, but it looks like the thing I needed.
Either way, thank you for all your hard work. I will most likely be back with either questions or more praise. ;)
 
  • Like
Reactions: DK

DK

Veteran
Veteran
Joined
Mar 30, 2016
Messages
396
Reaction score
375
First Language
Russian
Primarily Uses
RMMZ
Version 4.1

What's new:
1. Added the ability to change the language in the game options.
2. Added compatibility with the plugin YEP_QuestJournal (more in the updated help).
 

DK

Veteran
Veteran
Joined
Mar 30, 2016
Messages
396
Reaction score
375
First Language
Russian
Primarily Uses
RMMZ
Version 4.2

What's new:
1. Added support for arrays in JSON files.
2. Fixed display of game currency.
 

DK

Veteran
Veteran
Joined
Mar 30, 2016
Messages
396
Reaction score
375
First Language
Russian
Primarily Uses
RMMZ
Version 4.3

What's new:
The functions "Use different files for each language" and "Use an unlimited number of translation files" can now work in browsers and on mobile devices (you need to select the file system mode "Nwjs + Stamp" in the DKTools plugin).

The plugin now requires a minimum version of DKTools 8.0.1.

Also updated demo!
 

DK

Veteran
Veteran
Joined
Mar 30, 2016
Messages
396
Reaction score
375
First Language
Russian
Primarily Uses
RMMZ
Version 4.3.1

Help display bug fixed.
 

DK

Veteran
Veteran
Joined
Mar 30, 2016
Messages
396
Reaction score
375
First Language
Russian
Primarily Uses
RMMZ
Version 4.4.0

Added the ability to enable language selection the first time you start the game.
 

DK

Veteran
Veteran
Joined
Mar 30, 2016
Messages
396
Reaction score
375
First Language
Russian
Primarily Uses
RMMZ
Version 4.5.0

What's new:
1. Improved compatibility with Yanfly plugins and plugins that somehow interact with Window_Message.
 

MG1908

Warper
Member
Joined
Jan 5, 2020
Messages
3
Reaction score
0
First Language
Chinese
Primarily Uses
RMMV
Nice work!! And I use it now! !
Feedback one, I am not sure what's wrong, maybe compatibility...as i installed many plugins in MV :(
I made a apk file for android. After calling the language window from the Title Scene, i can't do the selection, just tap the default item or cancel;_;
This does not happen on PC.:guffaw:
 

DK

Veteran
Veteran
Joined
Mar 30, 2016
Messages
396
Reaction score
375
First Language
Russian
Primarily Uses
RMMZ
Nice work!! And I use it now! !
Feedback one, I am not sure what's wrong, maybe compatibility...as i installed many plugins in MV :(
I made a apk file for android. After calling the language window from the Title Scene, i can't do the selection, just tap the default item or cancel;_;
This does not happen on PC.:guffaw:
Thank you for your feedback.
This is a known issue. I have already fixed it and will post it in the next update.
 

DK

Veteran
Veteran
Joined
Mar 30, 2016
Messages
396
Reaction score
375
First Language
Russian
Primarily Uses
RMMZ
Version 4.6.0

What's new:
  • Faster image and audio loading
  • Basic compatibility of the resource preload function from the DKTools plugin and localized resources (more in the help)
  • Fixed a language selection error on mobile devices
  • Updated help
Due to the fact that I have subscribers, public plugins will be updated with a noticeable lag. This update will be publicly available no earlier than in a month. Subscribe and get updates first.
 

DK

Veteran
Veteran
Joined
Mar 30, 2016
Messages
396
Reaction score
375
First Language
Russian
Primarily Uses
RMMZ
A new kind of language selection with various settings in the next update!
An old view will also be available.
Work in progress.
ScreenCaptureProject1.gif
 

Savidiy

Warper
Member
Joined
Jun 21, 2020
Messages
3
Reaction score
0
First Language
Russian
Primarily Uses
RMMV
How do I make sure that the text from the localization is used when choosing a name (with Name Input Processing)?
1593550119797.png
 
  • Wow
Reactions: DK

DK

Veteran
Veteran
Joined
Mar 30, 2016
Messages
396
Reaction score
375
First Language
Russian
Primarily Uses
RMMZ
How do I make sure that the text from the localization is used when choosing a name (with Name Input Processing)?
Thanks for writing to me. I think this is a bug and I will fix it in the next update. But I must note that the name entered by the user is not subject to localization. It will be displayed in all languages as it entered it.
 

Latest Threads

Latest Posts

Latest Profile Posts

I've got good news and bad news. The good news is, there aren't any bad news to report. The bad news is, there aren't any good news to report.

Or as others say, yesterday was uneventful.


I am curious that can you "understand/get the point" about what does this place do generally?
(ARPG game)
If anyone knows any C# programmers, please send them my way.
Chilling at night in a tavern.
ChillingAtTavern.png

After 'multiple breakdowns', it's finally over. 10/10 will do this again.
Ever notice that villains can reform and become better people, but heroes can only ever die... or live long enough to see themselves become villains?

Isn't that interesting?

Forum statistics

Threads
129,845
Messages
1,205,665
Members
171,006
Latest member
Joylearning
Top