[XP][VXA] Localization

Started by ForeverZer0, July 26, 2012, 09:39:00 pm

Previous topic - Next topic

ForeverZer0

July 26, 2012, 09:39:00 pm Last Edit: April 22, 2013, 04:37:01 pm by KK20
Localization
Authors: ForeverZer0, KK20
Version: 1.1
Type: Multilingual Game Tool
Key Term: Game Utility



Introduction

This script adds support for creating games that support multiple languages. The files for each culture are in .ini format and located externally so that they can be easily translated and used by simply dropping the language file into the game's "Localization" folder.


Features


  • Uses IDs to get strings from external .ini files, which can be easily edited in any text editor, such as Notepad

  • Supports special characters used by non-English languages

  • Included message commands to simplify making your multilingual game, you use the command the same as you would the normal switch and variable commands

  • Also supports using in the Bitmap#draw_text methods so that custom scripts that draw onto Sprite bitmaps instead of Windows will still work without the need for customization

  • Automatically saves/loads the current culture




Screenshots

None.


Demo

[XP] Demo Link (Thank Google for the wonderful translations...)


Script

#+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
# Localization
# Author: ForeverZer0
# Version: 1.1
# Date: 7.27.12
#+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
#                             VERSION HISTORY
#+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
# v.1.0  7.26.12
#   - Initial release
# v.1.1  7.27.12
#   - Added ability to use any string as the ID instead of just numbers
#   - Added an alert message when a string is not found in the localization
#     file and the game is being ran in DEBUG mode
#+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
#
# Introduction:
#   This script adds support for creating games that support multiple languages.
#   The files for each culture are located externally so that they can be easily
#   translated and used by simply dropping the language file into the games
#   "Localization" folder.
#
# Features:
#   - Uses IDs to get strings from external .ini files, which can be easily
#     edited in any text editor such as Notepad
#   - Supports special characters used by non-English languages
#   - Included message commands to simplify making your multilangual game, you
#     use the command the same as you would the normal switch and variable
#     commands
#   - Also supports using in the Bitmap#draw_text methods so that custom scripts
#     that draw onto Sprite bitmaps instead of Windows will still work without
#     the need for customization
#   - Automatically saves/loads the current culture
#
# Instructions:
#   - Place the script anywhere in the editor
#   - Define the name of the language directory and default culture below
#   - The names of the cultures can be anything, I would stick to the convention
#     of naming files in the normal convention of "language-region" initials,
#     such as "en-US" (English, USA), "es-ES" (Spanish, Spain), etc., etc.
#   - Each language file should be a file with an .INI extension. If you are
#     unfamiliar with how .ini files are written, do a quick Google search, they
#     are quite simple.
#   - The .ini file should have only one section, which is the name of the
#     culture.
#             ex. [en-US]
#             ex. [es-ES]
#   - After that, you can simply begin to write the id-value pairs of each
#     string used in the culture.
#             ex. 1=This is a string
#             ex. 2=This is a string with ID 2
#             ex. GameIntro_01=This is a string with ID "GameIntro_01"
#   - Most importantly, the files must be saved in UTF-8 WITHOUT BOM. BOM stands
#     for "byte-order marker" and is a two byte value that is written to UTF8
#     files as a marker to other applications that they are encoded in UTF8.
#     WinAPI does not support this, so it must be saved without it. The text
#     will not appear if you fail to do this.
#   - Simply drop the completed files into the Localization folder
#   - To change the culture in game, use the following script command:
#         Localization.culture = CULTURE
#     CULTURE should be a string value that is the name of the file, without
#     extension
#             ex. Localization.culture = "en-US"
#  
#+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+

#===============================================================================
# ** Localization
#-------------------------------------------------------------------------------
# Static module for reading localized strings from language files.
#===============================================================================

module Localization
 #-----------------------------------------------------------------------------
 # * Constants
 #-----------------------------------------------------------------------------
 DIRECTORY = "Localization"
 DEFAULT_CULTURE = 'en-US'
 #-----------------------------------------------------------------------------
 # * Public instance variables.
 #-----------------------------------------------------------------------------
 attr_reader :culture
 attr_reader :filename
 #-----------------------------------------------------------------------------
 # * Initialize the localization module
 #-----------------------------------------------------------------------------
 def self.init
   @ini = Win32API.new('kernel32', 'GetPrivateProfileString', 'PPPPLP', 'L')
   unless File.directory?(DIRECTORY)
     Dir.mkdir(DIRECTORY)
   end
   path = ".\\#{DIRECTORY}\\CurrentCulture.txt"
   self.culture = File.exists?(path) ? IO.readlines(path)[0] : DEFAULT_CULTURE
 end
 #-----------------------------------------------------------------------------
 # * Set the current culture
 #-----------------------------------------------------------------------------
 def self.culture=(value)
   filename = ".\\#{DIRECTORY}\\#{value}.ini"
   if File.exists?(filename)
     @culture = value
     @filename = filename
     path = ".\\#{DIRECTORY}\\CurrentCulture.txt"
     File.open(path, 'wb') {|file| file.write(@culture) }
   else
     print "Cannot find language file for \"#{value}\"\n" +
       "Please ensure that the file \"#{filename}\" exists."
   end
 end
 #-----------------------------------------------------------------------------
 # * Read the string with the given ID of the current culture
 #-----------------------------------------------------------------------------
 def self.read(id)
   text = "\0" * 256
   @ini.call(@culture, id, '', text, 256, @filename)
   text.delete!("\0")
   if text == '' && $DEBUG
     print "No string defined!\nKey: \"#{id}\"\nCulture: \"#{@culture}\""
   end
   return text
 end
 #-----------------------------------------------------------------------------
 # * Parses a string for localization codes and returns it
 #-----------------------------------------------------------------------------
 def self.localize(string)
   if string != nil
     return string.gsub(/\\[Ll][Oo][Cc]\[(.+)\]/) { self.read($1) }
   end
 end
end

#===============================================================================
# ** Game_Temp
#===============================================================================

class Game_Temp
 #-----------------------------------------------------------------------------
 # * Overrids the setter for message text to localize the "Show Text" command
 #-----------------------------------------------------------------------------
 def message_text=(string)
   @message_text = Localization.localize(string)
 end
end

#===============================================================================
# ** Bitmap
#===============================================================================

class Bitmap
 #-----------------------------------------------------------------------------
 # * Replaces text based on the current culture
 #-----------------------------------------------------------------------------
 alias localized_draw_text draw_text
 def draw_text(*args)
   args.each_index {|i|
     args[i] = Localization.localize(args[i]) if args[i].is_a?(String) }
   localized_draw_text(*args)
 end
end

# Initialize static variables used in the module
Localization.init


#+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
# Localization
# Edit for VX-ACE by KK20
# Author: ForeverZer0
# Version: 1.1
# Date: 7.26.12
#+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
#                             VERSION HISTORY
#+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
# v.1.0  7.26.12
#   - Initial release
# v.1.1  7.27.12
#   - Added ability to use any string as the ID instead of just numbers
#   - Added an alert message when a string is not found in the localization
#     file and the game is being ran in DEBUG mode
#+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
#
# Introduction:
#   This script adds support for creating games that support multiple languages.
#   The files for each culture are located externally so that they can be easily
#   translated and used by simply dropping the language file into the games
#   "Localization" folder.
#
# Features:
#   - Uses IDs to get strings from external .ini files, which can be easily
#     edited in any text editor such as Notepad
#   - Supports special characters used by non-English languages
#   - Included message commands to simplify making your multilangual game, you
#     use the command the same as you would the normal switch and variable
#     commands
#   - Also supports using in the Bitmap#draw_text methods so that custom scripts
#     that draw onto Sprite bitmaps instead of Windows will still work without
#     the need for customization
#   - Automatically saves/loads the current culture
#
# Instructions:
#   - Place the script anywhere in the editor
#   - Define the name of the language directory and default culture below
#   - The names of the cultures can be anything, I would stick to the convention
#     of naming files in the normal convention of "language-region" initials,
#     such as "en-US" (English, USA), "es-ES" (Spanish, Spain), etc., etc.
#   - Each language file should be a file with an .INI extension. If you are
#     unfamiliar with how .ini files are written, do a quick Google search, they
#     are quite simple.
#   - The .ini file should have only one section, which is the name of the
#     culture.
#             ex. [en-US]
#             ex. [es-ES]
#   - After that, you can simply begin to write the id-value pairs of each
#     string used in the culture.
#             ex. 1=This is a string
#             ex. 2=This is a string with ID 2
#             ex. GameIntro_01=This is a string with ID "GameIntro_01"
#   - Most importantly, the files must be saved in UTF-8 WITHOUT BOM. BOM stands
#     for "byte-order marker" and is a two byte value that is written to UTF8
#     files as a marker to other applications that they are encoded in UTF8.
#     WinAPI does not support this, so it must be saved without it. The text
#     will not appear if you fail to do this.
#   - Simply drop the completed files into the Localization folder
#   - To change the culture in game, use the following script command:
#         Localization.culture = CULTURE
#     CULTURE should be a string value that is the name of the file, without
#     extension
#             ex. Localization.culture = "en-US"
#   
#+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+

#===============================================================================
# ** Localization
#-------------------------------------------------------------------------------
# Static module for reading localized strings from language files.
#===============================================================================

module Localization
  #-----------------------------------------------------------------------------
  # * Constants
  #-----------------------------------------------------------------------------
  DIRECTORY = "Localization"
  DEFAULT_CULTURE = 'en-US'
  #-----------------------------------------------------------------------------
  # * Public instance variables.
  #-----------------------------------------------------------------------------
  attr_reader :culture
  attr_reader :filename
  #-----------------------------------------------------------------------------
  # * Initialize the localization module
  #-----------------------------------------------------------------------------
  def self.init
    @ini = Win32API.new('kernel32', 'GetPrivateProfileString', 'PPPPLP', 'L')
    unless File.directory?(DIRECTORY)
      Dir.mkdir(DIRECTORY)
    end
    path = ".\\#{DIRECTORY}\\CurrentCulture.txt"
    self.culture = File.exists?(path) ? IO.readlines(path)[0] : DEFAULT_CULTURE
  end
  #-----------------------------------------------------------------------------
  # * Set the current culture
  #-----------------------------------------------------------------------------
  def self.culture=(value)
    filename = ".\\#{DIRECTORY}\\#{value}.ini"
    if File.exists?(filename)
      @culture = value
      @filename = filename
      path = ".\\#{DIRECTORY}\\CurrentCulture.txt"
      File.open(path, 'wb') {|file| file.write(@culture) }
    else
      print "Cannot find language file for \"#{value}\"\n" +
        "Please ensure that the file \"#{filename}\" exists."
    end
  end
  #-----------------------------------------------------------------------------
  # * Read the string with the given ID of the current culture
  #-----------------------------------------------------------------------------
  def self.read(id)
    text = "\0" * 256
    @ini.call(@culture, id, '', text, 256, @filename)
    text.delete!("\0")
    if text == '' && $DEBUG
      print "No string defined!\nKey: \"#{id}\"\nCulture: \"#{@culture}\""
    end
    return text
  end
  #-----------------------------------------------------------------------------
  # * Parses a string for localization codes and returns it
  #-----------------------------------------------------------------------------
  def self.localize(string)
    if string != nil
      return string.gsub(/\\[Ll][Oo][Cc]\[(.+)\]/) { self.read($1) }
    end
  end
end

#===============================================================================
# ** Game_Message
#===============================================================================

class Game_Message
  alias localized_text_add add
  def add(text)
    text = Localization.localize(text)
    strings = text.split("\\n")
    while strings.size > 0
      localized_text_add(strings.shift)
    end
  end
end

#===============================================================================
# ** Window_Base
#===============================================================================

class Window_Base
  alias localize_draw_text_ex draw_text_ex
  def draw_text_ex(x, y, text)
    text = Localization.localize(text)
    localize_draw_text_ex(x, y, text)
  end
end

#===============================================================================
# ** Bitmap
#===============================================================================

class Bitmap
  #-----------------------------------------------------------------------------
  # * Replaces text based on the current culture
  #-----------------------------------------------------------------------------
  alias localized_draw_text draw_text
  def draw_text(*args)
    args.each_index {|i|
      args[i] = Localization.localize(args[i]) if args[i].is_a?(String) }
    localized_draw_text(*args)
  end
end

# Initialize static variables used in the module
Localization.init



Instructions

Please see script for instructions.  The demo contains examples that will make much it much clearer.

How to Create a Language File: ShowHide

  • I highly suggest using Notepad++ to edit and create language files. It makes changing text encoding a simple click of the mouse (which is required), and syntax highlighting for .INI files. The rest of these instructions will be assuming you are using it.

  • Open up Notepad++ and create a new file. I strongly suggest to stick to the normal convention of naming files in the LANGUAGE-REGION format, where LANGUAGE and REGION are two-letter initials for their respective values. ex. "en-US", "en-GB", "fr-FR", etc., etc.

  • In the top menu bar, click "Encoding" and select "Encode in UTF-8 without BOM"

  • Create a section in the .ini file with the same name as the file (see image below)

  • Begin adding your id-string pairs into the file. The number/word for the IDs are arbitrary, but the they will be the numbers/word used to get the required strings throughout your game, so I recommend you use an order that helps you stay organized.

  • Save the file with an ".ini" extension by choosing "File" -> "Save As...", and selecting "MS ini file" from the combo box.

  • Drop the file into your game's "Localization" folder and set the current culture to the name you used, and your done.



How to use Localization in Your Game: ShowHide

  • Very simple. Pretty much anywhere you want to use a localized string, simply use the "\loc[ID]" command in place of the text, where the ID is obviously the ID specified in the language file.

  • This command can be used in "Show Text", "Show Choices", etc. commands, as well as within normal "draw_text" commands used by scripts. It can be used within the database editor for names of classes, words, elements, etc. Pretty much everywhere and anywhere. You may have to do a little search and replace of the few values that are hard-coded within the default scripts.

  • To change the current language, simply use the following command:

# This is an example, specify whatever culture you have defined
Localization.culture = 'en-US'





Compatibility

No known compatibility issues. Custom Message systems may require slight modification, though have not been tested. I can offer support for to making them compatible on a "per system" basis.


Credits and Thanks


  • ForeverZer0, for the script

  • KK20, for the VXA edit




Author's Notes

Please report bugs/issues so that may be resolved.
Feel free to request compatibility fixes if you have a Custom Message System that does not work with the script.
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

Blizzard

Just a small note: IDs should be strings as well. It's much easier to keep stuff in mind if you have strings as IDs/keys since it's easier to remember Forest_of_Illusion_Entry_Dialog_15 than 312547.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

ForeverZer0

There's actually nothing stopping you from using a string as it is right now, there would simply be a redundant "to_s" called on it. A string is actually what is passed to the API method.
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

G_G

This right here prevents us from using a string.
return string.gsub(/\\[Ll][Oo][Cc]\[([0-9]+)\]/) { self.read($1) }

ForeverZer0

Ah, shit, you're right, I'm thinking ahead to the next step. I can make a quick fix later, it will be simple.
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

Blizzard

Also test if newlines are processed properly. I'm not sure the .ini format allows processing them just like that.

Code: example
Intro_001=A long, long time ago in a
galaxy far, far away.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

G_G

Despite the minor detail, you still did a really nice job on this Zer0. It's a powerful script with so little code. Very well done!

Blizzard

I agree, cleverly executed. Have you thought about adding a debug-only window pop-up if a string has not been replaced? It would make finding unlocalized strings easier.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

ForeverZer0

Alrighty, I updated to allow strings as IDs as well. I also included the little pop-up window warning when strings are not found that Blizzard mentioned above (thanks).

After doing some testing and googling, Windows automatically escapes backslash characters within .ini files. This means that newline characters, etc. do not work. I spent about an hour trying to figure how to simply have the system look for escaped backslashes and convert them back, but I can't seem to get that to work.

I have also done a bit of messing around with Unicode characters, and am hitting a brick wall with that. Ruby 1.8.1 (RMXP's version) simply does not have enough Unicode support to be able to translate text into Chinese, Arabic, Japanese, and other languages like that. The strings are read being correctly from the .ini file (you can insert a "p text" in the read method before the return to see that much), but fail to be drawn correctly on windows. I have tried every sort of encoding combination, unpacking and repacking strings on the fly from UTF-8 to Latin, and nothing works. This is a issue with the underlying library that cannot be fixed with a script as far as I know how. Later version of Ruby (1.9 and above) fixed these issues, but I cannot find a proper work around that is gonna help when being stuck using Ruby 1.8.1.
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

Blizzard

You could use a custom .ini parser. Ruby 1.8.1 should properly read UTF8 encoded files. Just make sure that you skip the BOM at the beginning manually. You can refer to aprilui's Dataset::_loadTexts method to see how it's done. Keep in mind that Unicode != UTF8. I'm not sure if reading an .ini actually gives you Unicode characters. If yes, simply convert them to UT8. All my Input modules include a method for conversion, you can use that one.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

ForeverZer0

No, you misunderstand, the text being read from the files is correct. That's not the problem, I can use "p text" and the characters display perfectly in the little pop-up window, but if when you try to draw it to a window, nothing works. I could manually remove the BOM and it would make no difference. The BOM only has an effect on WinAPI, and has nothing to do with Ruby. I am saying that RMXP cannot handle the text.

This is what I am talking about. Put this code in the editor:
$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


Here are the results:
Spoiler: ShowHide

Spoiler: ShowHide
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

Blizzard

That's not RMXP being stupid there, that's the font not supporting the characters. Try "Arial Unicode MS" and/or "Arial Unicode MS Regular" and it should work.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

ForeverZer0

I have tried various Unicode fonts. They seem to have no problem displaying the same exact text in various other applications, but will not work in RMXP when I use the same exact font.
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

Blizzard

RMXP was originally Japanese software, that's really odd. :/
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

ForeverZer0

They are actually Chinese characters. I have yet to try Japanese.
I figured I would test with the most problematic, and if I can get that, its all good.

I still don't understand why the same text will display in one application and not RMXP, though.
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

azdesign

@ForeverZer0
There is nothing wrong with the font, look at this screenshot :

Spoiler: ShowHide



I'm using english RPG Maker and the japanese characters shown up properly in console window and message window.
All I did was to change the library using RGSS103J.dll. Set my locale to japanese, that's all.
That was a text from "show text". How about variable then? look at below screenshot :

Spoiler: ShowHide


That was from your script :

Spoiler: ShowHide

$data_system = load_data('Data/System.rxdata')
$game_system = Game_System.new
japs = 'こんにちわ'
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, 'Japanese : ' + japs, 1)
loop { Graphics.update; Input.update; break if Input.trigger?(Input::C) }
p japs


So I think the problem is not on how RMXP draw the text, instead, how it store the text from external file.
I don't know if this help, but well, I just giving you my thoughts.
~ Check out my deviantart http://my-az-design.deviantart.com/ ~

Blizzard

Now we know what the update for RGSS103J.dll was for. xD
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

azdesign

August 01, 2012, 09:07:54 am #17 Last Edit: August 01, 2012, 09:14:40 am by azdesign
Showing japanese text problem has solved, but still no luck with showing japanese text from .ini file. Tried saving it into different encoding etc. The result was the text are invisible, or in random boxes.

Then I decided to do something much basic :

1. Create a plain text file encoded with UTF-8, inside the file, there are 2 lines, こんにちわ and はじめまして
2. Create a simple method to read a file and output each line using a window, save it, change the library to to RGSS103J.dll
3. Voila, the text properly extracted from .txt file and displayed properly just like the third screenshot from my last post.

Waiting for the next script update.  :)
~ Check out my deviantart http://my-az-design.deviantart.com/ ~

Rahvin

Hi,

I'm new to rpg maker and I'm using VX Ace.

I really need a localization script but I do not get this one to work.
I created the localization files as mentioned in the script but the translation does not work.

The script itself seems to get called as the CurrentCulture.txt file is created automatically when testing the game.

Im using the script for example in a show_text event as following: /loc[test_item]. The output in the game is [test_item].

Can anyone please help me to get this run under VX Ace or point me to another working localization script?

Many thanks in advance!

ThallionDarkshine

In the instructions it says to use \loc[id], not /loc[id]. Try using that.