Created
July 9, 2013 02:58
-
-
Save mamemomonga/5954353 to your computer and use it in GitHub Desktop.
OSX用 日本語ローカライズされたディレクトリを作成
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
use utf8; | |
binmode(STDIN,':utf8'); | |
binmode(STDOUT,':utf8'); | |
use File::Path; | |
# 参考 | |
# http://msyk.net/macos/jaguar-localize/ | |
if(!$ARGV[0] || !$ARGV[1]) { | |
print "USAGE: $0 [en_name] [ja_name]\n"; | |
exit; | |
} | |
my $en_name=$ARGV[0]; | |
my $ja_name=$ARGV[1]; | |
utf8::decode($en_name); | |
utf8::decode($ja_name); | |
my $basedir="$en_name.localized"; | |
mkpath("$basedir/.localized"); | |
{ | |
open(my $fh,'>:utf8',"$basedir/.localized/en.strings") || die $!; | |
print $fh qq{"$en_name" = "$en_name";\n}; | |
} | |
{ | |
open(my $fh,'>:utf8',"$basedir/.localized/ja.strings") || die $!; | |
print $fh qq{"$en_name" = "$ja_name";\n}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment