diff --git a/mklang.rb b/mklang.rb index 3aba647..02ad601 100755 --- a/mklang.rb +++ b/mklang.rb @@ -15,6 +15,12 @@ po = GetPomo::PoFile.parse(File.read(src_file)) File.open(dst_file, 'wb') do |file| file.write(Marshal.dump(po.map do |t| - [Zlib.crc32(t.msgid), t.msgstr] + id = t.msgid + msg = t.msgstr + id = id.gsub("\\\\","\\") + id = id.gsub("\\\"", "\"") + msg = msg.gsub("\\\\","\\") + msg = msg.gsub("\\\"", "\"") + [Zlib.crc32(id), msg] end.to_h)) end diff --git a/scripts/Sprite_MapText.rb b/scripts/Sprite_MapText.rb index b15a13f..e60c550 100644 --- a/scripts/Sprite_MapText.rb +++ b/scripts/Sprite_MapText.rb @@ -10,11 +10,11 @@ class Sprite_MapText < Sprite self.zoom_x = 2 self.zoom_y = 2 self.bitmap = Bitmap.new(200, 24) - + #calculate text width spacewidth = self.bitmap.text_size(' ').width width = 0 - + text.split(' ').each do |word| # Get width of this word @@ -22,17 +22,21 @@ class Sprite_MapText < Sprite width += spacewidth end width -= spacewidth - + + if width <= 0 + width = 1 + end + self.bitmap.dispose self.bitmap = Bitmap.new(width, 24) self.bitmap.font.color = Color.new(81, 33, 129, 255) - self.bitmap.draw_text(0,0, width, 24, text) + self.bitmap.draw_text(0,0, width, 24, text) self.src_rect.set(0, 0, width, 24) self.oy = 24 self.ox = width/2 - - + + update end diff --git a/scripts/i18n_Language.rb b/scripts/i18n_Language.rb index 7eeb4d0..6881250 100644 --- a/scripts/i18n_Language.rb +++ b/scripts/i18n_Language.rb @@ -9,7 +9,7 @@ class Language FONT_WESTERN = 'Terminus (TTF)' FONT_CJK = 'WenQuanYi Micro Hei' LANG_WESTERN = [ - 'en', 'fr', 'pt_BR' + 'en', 'fr', 'pt_BR', 'es' ] LANG_CJK = [ 'ja', 'ko', 'zh_CN'