mirror of
https://forgejo.xatacraft.ru/Sunshine/mkxp-sunshine.git
synced 2026-08-19 13:29:54 +00:00
20 lines
354 B
Ruby
Executable file
20 lines
354 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|
|
|
[Zlib.crc32(t.msgid), t.msgstr]
|
|
end.to_h))
|
|
end
|