Detect which language of MV is being used by the plugin user

Rafael_Sol_Maker

Almighty God Jabu
Veteran
Joined
May 8, 2012
Messages
129
Reaction score
56
First Language
Portuguese
Primarily Uses
RMMV
Hello everyone,

I think this questions was already asked for someone. Well, I'm guessing. I tried searching for it, but I couldn't find anything.

I don't know how to determine which language the final user of my plugins is using its RPG Maker MV. I want to know that so I can display some error messages in the proper language.

So I can do this...
Code:
throw new Error("Erro: O índice do herói escolhido não está configurado.");
...in my go'old portuguese and in english as well.

I already know that I can use different headers for each language.
(Well, I wrote about it in my e-magazine: )

But nothing specifically comes here to determine which language is being used other than doing an overly complicated arrange of plugin parameters to try to guess.

I'm still trying to search a simpler answer in the base code, but no luck yet.

Any advices? Thanks for your time.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
Window_NameInput uses functions in Game_System to determine the language. However, it's based on $dataSystem, which could be what the developer sets up when they deploy.
 

Rafael_Sol_Maker

Almighty God Jabu
Veteran
Joined
May 8, 2012
Messages
129
Reaction score
56
First Language
Portuguese
Primarily Uses
RMMV
Thanks for the reply, @Shaz! I checked what you said, and I found this:

Hopefully I can try the same test to see if I can spot portuguese data system. I will need to change some configs here, maybe in Steam, maybe my system language.

After the tests I will let everyone knows if I succeed.

Hopefully it's related to the RPG Maker MV the user use and not just only some gimmick to show special characters in Name Input screen.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
The thing is, $dataSystem comes from the System tab in the editor, and is saved in System.json

I suspect that may be the locale that's set on the developer's PC, not on the player's. There is nothing I can see that indicates it pulls the information from the player's PC.

If that's true, then it wouldn't be a reliable test for your purpose.
 

ChampX

Veteran
Veteran
Joined
Aug 14, 2016
Messages
204
Reaction score
136
First Language
English
Primarily Uses
You can use navigator.language to return a locale code representing the language the installed browser is using. I have changed my system locale in the past and it did return the appropriate locale code. Since MV uses chromium under the hood, you do not need to worry about cross browser compatibility (unless you do a web deployment that is).
 
Last edited:

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,862
Messages
1,017,047
Members
137,569
Latest member
Shtelsky
Top