From: Petter Reinholdtsen Date: Fri, 16 Feb 2018 07:07:13 +0000 (+0000) Subject: Avoid hardcoding po file name. X-Git-Tag: es-printed~493 X-Git-Url: https://pere.pagekite.me/gitweb/text-madewithcc.git/commitdiff_plain/3a4bd75be002c79ae2ba3f68b62598dc1ef7d93f Avoid hardcoding po file name. --- diff --git a/fixup-migrate-gettext.rb b/fixup-migrate-gettext.rb old mode 100644 new mode 100755 index 9bb7ec8..eb255da --- a/fixup-migrate-gettext.rb +++ b/fixup-migrate-gettext.rb @@ -58,5 +58,7 @@ class PoStr end end -file = 'po/es/mwcc.po' +raise ArgumentError, 'Source file not specified' if ARGV.size != 1 +file = ARGV[0] strings = File.open(file,'r').read.split(/\n\n/)[1..-1].map {|str| PoStr.new(str)} +print strings