mirror of
https://forgejo.xatacraft.ru/Sunshine/mkxp-sunshine.git
synced 2026-08-19 21:39:57 +00:00
Make MapText not crash when trying to create negative-width bitmaps Add special rules to mklang
26 lines
500 B
Ruby
Executable file
26 lines
500 B
Ruby
Executable file
#!/usr/bin/ruby
|
|
|
|
require 'get_pomo'
|
|
require 'zlib'
|
|
|
|
if ARGV.length != 2
|
|
STDERR.puts "usage: mklang.rb src_file out_file"
|
|
exit 1
|
|
end
|
|
|
|
src_file = ARGV[0]
|
|
dst_file = ARGV[1]
|
|
|
|
po = GetPomo::PoFile.parse(File.read(src_file))
|
|
|
|
File.open(dst_file, 'wb') do |file|
|
|
file.write(Marshal.dump(po.map do |t|
|
|
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
|