[RPGXP] ForeverZer0's Localization script compatible with choices + \n code in files.

Andrea87Sky

Just a random musician, eventer and spriter.
Veteran
Joined
Aug 30, 2017
Messages
119
Reaction score
1
First Language
Italian
Primarily Uses
RMXP
ForeverZer0'S Localization script is an awesome script that replaces correctly the text to a translated version with a code, the only two problems are though that choices windows aren't compatible with it, and the \n command in the translation files doesn't work, forcing me to create a different translation code for each line.

So, yeah. Is it possible to add those features?
 

KK20

Just some XP Scripter
Veteran
Joined
Oct 11, 2018
Messages
279
Reaction score
105
First Language
English
Primarily Uses
RMXP
Are you using some custom message script? Choices work for me. I can imagine if the choices are drawn character-by-character that the localization script wouldn't work.

I'd have to take another look at the newline character for Show Message. I apparently had implemented a snippet for a user in that thread, but it was for VXA. In XP, newlines help the event interpreter know how many lines the message will take in the message box. This lets it know whether it has enough space to fit choices or a number input alongside the previous message.

Outside of that though, it should be as simple as replacing with
Code:
  def self.localize(string)
    if string != nil
      s = string.gsub(/\\[Ll][Oo][Cc]\[(.+)\]/) { self.read($1) }
      s.gsub!("\\n", "\n")
      s
    end
  end
 

Andrea87Sky

Just a random musician, eventer and spriter.
Veteran
Joined
Aug 30, 2017
Messages
119
Reaction score
1
First Language
Italian
Primarily Uses
RMXP
Are you using some custom message script? Choices work for me. I can imagine if the choices are drawn character-by-character that the localization script wouldn't work.

I'd have to take another look at the newline character for Show Message. I apparently had implemented a snippet for a user in that thread, but it was for VXA. In XP, newlines help the event interpreter know how many lines the message will take in the message box. This lets it know whether it has enough space to fit choices or a number input alongside the previous message.

Outside of that though, it should be as simple as replacing with
Code:
  def self.localize(string)
    if string != nil
      s = string.gsub(/\\[Ll][Oo][Cc]\[(.+)\]/) { self.read($1) }
      s.gsub!("\\n", "\n")
      s
    end
  end
It works, thanks! (I mean, only the \n thing, I still need help with the choices.) Also yeah, I use UMS. I forgot to mention that.
 
Last edited:

Andrea87Sky

Just a random musician, eventer and spriter.
Veteran
Joined
Aug 30, 2017
Messages
119
Reaction score
1
First Language
Italian
Primarily Uses
RMXP
Bump, I still need a method to allow UMS's choices to be compatible with the Localizations script.
 

KK20

Just some XP Scripter
Veteran
Joined
Oct 11, 2018
Messages
279
Reaction score
105
First Language
English
Primarily Uses
RMXP
Can you try putting this below UMS
Code:
class Game_Temp
  def choices=(strings)
    strings.map! { |s| Localization.localize(s) }
    @choices = strings
  end
end
 

Andrea87Sky

Just a random musician, eventer and spriter.
Veteran
Joined
Aug 30, 2017
Messages
119
Reaction score
1
First Language
Italian
Primarily Uses
RMXP
Can you try putting this below UMS
Code:
class Game_Temp
  def choices=(strings)
    strings.map! { |s| Localization.localize(s) }
    @choices = strings
  end
end
It worked! Thank you so much!
 

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

Latest Threads

Latest Profile Posts

Why is there so much month left at the end of money? D=
Hello humans! How goes your day in this journey of living? I hope it is good, for I am human like you, and I am feeling great! Worship the altar.
Sand is basically small rocks

Forum statistics

Threads
105,613
Messages
1,014,994
Members
137,280
Latest member
Soraaa510
Top