Jump to content
New account registrations are disabed. This website is now an archive. Read more here.
  • 0
azdesign

Best approach for localization

Question

Consider that I want to publish a game in different languages. While maybe I'm not the one who provide the translations, I want everyone, can easily grab the entire dialogues file and translate them using a text editor. No need to own RPG Maker, no need to have scripting skills to do that for sure.

 

So here are my thoughts based on my current experience and knowledge :

 

1. Rather than using RPG Maker to show text manually stored inside an event, how about create a single global variable called DIALOGUES, which is a container to the entire dialogues, could it be text, system message, menu label, etc. This variable is categorized, and each category items has its own ID. For example :

 

 

 

DIALOGUES = { :Common => [#this is ID no 0-5"Hello, how do you do?","Welcome to the village!",.....#this is ID no 6-10#and so on ], :Another_Category => []}

 

 

then in "Show Text" just call DIALOGUES[:Common][0] which result in "Hello, how do you do?". This approach could also eliminate redundancy. Gonna need to alter message-related class to do this

 

2. Store that variable in a .rb file, separated from the rest of the file, so anyone can just grab it and start the translation.

 

3. At the game start, check the file integrity, to avoid corrupt, ID mismatch, missing, etc. If invalid, use the default language pack stored inside the .rgssad and store in into memory (I dunno if.. lets say 2500 lines worth of dialogues will take a long time to load)

 

or, rather than any ruby related variable, what if the dialogues stored in a plain text file ? I'm not sure how to keep track of each dialogue though. Gonna invent some text grabbing method maybe for easier call.

I also curious how to overcome problems for non-alphabet characters such as kanji and arabic not properly showing up (mostly displayed as boxes).

 

I think that's it. Anyone has better ideas of what kind of approach for localization? Please share your thoughts here smile.png Thanks in advance

Edited by azdesign

Share this post


Link to post
Share on other sites

8 answers to this question

Recommended Posts

  • 0

You can use external files pretty easily. You could even use GetPrivateProfileString from Windows API (use Win32API) to get text based on key/value pairs in an .ini file. Use UTF-8 encoding in the files to eliminate the non-standard characters issue. I can make you a quick method for getting string values from an .ini file using integer IDs if you would like.

Actually, I have a pretty good idea for a very basic script that should suit your needs, as well as allow for easy translation. Give me a few minutes and I will post it up.

Share this post


Link to post
Share on other sites
  • 0

Just got it done, works perfectly, is simple to use, and supports non-standard characters.

I'm gonna make a topic up and post in a little bit.

 

EDIT:

I was going to post the topic on this site, but the formatting and BBCode on this site is an absolute atrocity, and I am not reformatting and typing out a whole new topic just to appease it. The whole "preview as you type" thing here is the worse extension I have ever seen added on a forum. OK, rant over.

 

http://forum.chaos-project.com/index.php/topic,12164.0.html

Edited by ForeverZer0

Share this post


Link to post
Share on other sites
  • 0

Wow you made it quickly. I tried the demo, the result was just like what I hoped for nice work. Never touched Win32API before, lol need to learn more. Anyway the .txt file unicode has no problem handling non-standard characters but the parser seems to have problem. I tried using japanese characters into it. It read as "p}". I made sure my system locale changed into japanese

 

Maybe the RTP should also changed into its corresponding language ? Or are there specific configuration we can change to solve this ? Currently I'm using english RTP(RGSS102E.dll). Don't know why, switching to japanese RTP made the text invisible. Maybe some font missing..

 

Anyway, thank you for the script. gonna learn every bit of it and make my own one. (lol for commercial product I don't want to have copyright issues) smile.png

Edited by azdesign

Share this post


Link to post
Share on other sites
  • 0

I updated the script and it now allows for using strings as IDs also. This will allow you to name values in a way that makes sense in keeping track of things instead of solely arbitrary numbers that mean nothing. I also included a little pop-up window (DEBUG only) that alerts you if a localized string is not found in a file.

 

@azdesign:

The problem is not with the script, nor Windows, its RMXP. It uses Ruby 1.8.1, which only contains partial support for Unicode characters. As far as I am aware, there is no real way to "cheat" it. Believe me, I have tried many different encodings, and even manually unpacked the string and tried repacking it with different methods, nothing works. These issues were solved with Ruby 1.9 when it got full Unicode support, but there isn't much that you are gonna do when using RMXP and its outdated version of Ruby.

 

Also, as far as "copyright" stuff goes, this script is the same as any other script I have ever written for RMXP: I could care less if its used commercially, nor do I ask that any profit be given to me. I have absolutely no ambitions when it comes to RMXP on anything commercial. The only thing I have ever asked is that my scripts not be taken and claimed as someone else's, and a simple name in the credits is all the "payment" I require. People have asked before, and I have signed waivers supporting this, as I will do for you if you want. I write (or at least used to write...) RMXP scripts for only one reason: a personal hobby. I could care less what happens to a script of mine, if no one ever uses it, or I never "release" it. It doesn't bother me, the purpose was not for any of that, but just the enjoyment I got creating it.

Share this post


Link to post
Share on other sites
  • 0

@ForeverZer0

Hmm.. I also did some experiments with this and none seems work. But hey, These are just coming up in my mind but I don't know how to do it, maybe you can help me with this :

 

You see, putting a japanese character directly inside the script without calling them from an external file works fine. It shows up properly when called ( for example, create a variable with japanese characters as its value). The problem arise when these characters are taken from outside (.ini file) to be parsed inside (IO -> String). So i thought about this. How if we just store the characters in form of code (like ASCII code for alphabets) in .ini file and then the script grab it then convert those code into its corresponding character ? The parser would use its internal encoding so I think maybe this might works.

 

This is the chart : http://www.rikai.com...s.unicode.shtml

 

I don't know how to do it nor I know whether there is a method in rgss to do that, I'm new to to ruby, but have experience using java, php, etc so I know the logic. If you're willing to help me with this please let me know the result.

 

The next solution is like what I stated at the first time, to store the localization dialogues inside a script in form of array/hash. This will eliminate the purpose "everyone can grab it and translate it into any language using any text editor" though. Maybe we can just export the variable into a text file, wait until someone provide translation, then we apply the translation into the script and then repackage the game. At least, no need to manually check every event and translate each dialogue.

 

I hope not to resort in using newer version of RPG Maker. I personally dislike the "chibi-style" of RMVX and Ace along with their automatic layer mapping and smaller screen. Curse them all. Oh well.., because the original purpose was to distribute the game into english and japanese, maybe for the time being I'm gonna stick with the array/hash.

 

If I'll be using your scripts in the future, either the entire scripts or modified one, I will definitely put your name and any links you want me to provide on the credit. I respect the work of an author who put their hard work to be shared on the community. Maybe if you want, I can give you a single copy of completed game when it is published. Then again, thanks for the script. smile.png

Edited by azdesign

Share this post


Link to post
Share on other sites
  • 0

What version of RGSS####.dll are you using?

I was running some tests using Chinese characters, and I cannot get them to display in a game window, even when the text is written in the editor.

 

Here's the little example scriptlet I made for a test:

 

$data_system = load_data('Data/System.rxdata')
$game_system = Game_System.new
chinese = '你好世界。'
window = Window_Base.new(160, 208, 320, 96)
window.contents = Bitmap.new(192, 64)
window.contents.draw_text(0, 0, 192, 32, 'Encoding: ' + $KCODE, 1)
window.contents.draw_text(0, 32, 192, 32, 'Chinese:' + chinese, 1)
loop { Graphics.update; Input.update; break if Input.trigger?(Input::C) }
p chinese

 

As you can see, its the same problem I said above. The text displays correctly in the pop-up window, but not within the game window.

Share this post


Link to post
Share on other sites
  • 0

I have RTP1.03 installed (japanese installer, so presumably RGSS103J.dll), set locale into japanese, editor is english japanese version. Either japanese text inside an event, or japanese character as variable value shows up properly in either pop-up window(print) and message window. No problem as long as the character is inside the editor

 

EDIT :

 

I'm currently using JAPANESE editor, so that's explain the thing. I install english editor and it wont display text properly just like you said. So I make sure with RMVX, result :

 

RMXP : wont display jap text inside game window unless the editor is jap as well. changing rgss##.dll doesn't have any effect.

RMVX : display the jap text inside game window, pop ups, even editor and .dll is in english

either version DEPENDANT on system locale. jap text jumbled if system locale was not set to jap in VX

So dead end with ruby 1.8.1

 

now I'm working on XP-ization of VX. Gonna import all tileset, charset. etc. Hate those chibi chars.

 

MORE EDIT :

 

I performed another test, involving a japanese rpg maker game. I run them and the game just fine. Now I save the game using English editor, everything messed up, text are gone

 

So this is really dependant with the editor version, my theory is, the editor has built in encoding, regardless rgss####.dll and system locale. The result is, jap text saved using jap editor shows fine. Jap text in english editor messed up. Jap text from a jap game edited and saved using english editor became messed up.

Edited by azdesign

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...