From bffb79fba461a034969632b28f5e8512ccf34357 Mon Sep 17 00:00:00 2001 From: Kay Marquardt Date: Sun, 22 Dec 2019 16:38:25 +0100 Subject: [PATCH] translate usermin ulang files if exist --- chinese-to-utf8.pl | 37 ++++++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/chinese-to-utf8.pl b/chinese-to-utf8.pl index c6f1ce1e7..6e0023252 100755 --- a/chinese-to-utf8.pl +++ b/chinese-to-utf8.pl @@ -73,7 +73,42 @@ foreach $m (@modules) { system("iconv -f iso-8859-1 -t UTF-8 - <$m/lang/$l >$m/lang/$l.UTF-8"); } } - + # Translate the ulang/* files + if (-r "$m/ulang/zh_TW.Big5") { + system("iconv -f Big5 -t UTF-8 - <$m/ulang/zh_TW.Big5 >$m/ulang/zh_TW.UTF-8"); + } + if (-r "$m/ulang/zh_CN") { + system("iconv -f GB2312 -t UTF-8 - <$m/ulang/zh_CN >$m/ulang/zh_CN.UTF-8"); + } + if (-r "$m/ulang/ja_JP.euc") { + system("iconv -f EUC-JP -t UTF-8 - <$m/ulang/ja_JP.euc >$m/ulang/ja_JP.UTF-8"); + } + if (-r "$m/ulang/ko_KR.euc") { + system("iconv -f EUC-KR -t UTF-8 - <$m/ulang/ko_KR.euc >$m/ulang/ko_KR.UTF-8"); + } + if (-r "$m/ulang/ru_SU") { + system("iconv -f KOI8-R -t UTF-8 - <$m/ulang/ru_SU >$m/ulang/ru.UTF-8"); + } + foreach $l (@fiveone_langs) { + if (-r "$m/ulang/$l") { + system("iconv -f windows-1251 -t UTF-8 - <$m/ulang/$l >$m/ulang/$l.UTF-8"); + } + } + foreach $l (@fivenine_langs) { + if (-r "$m/ulang/$l") { + system("iconv -f iso-8859-2 -t UTF-8 - <$m/ulang/$l >$m/ulang/$l.UTF-8"); + } + } + foreach $l (@fifteen_langs) { + if (-r "$m/ulang/$l") { + system("iconv -f iso-8859-15 -t UTF-8 - <$m/ulang/$l >$m/ulang/$l.UTF-8"); + } + } + foreach $l (@default_langs) { + if (-r "$m/ulang/$l") { + system("iconv -f iso-8859-1 -t UTF-8 - <$m/ulang/$l >$m/ulang/$l.UTF-8"); + } + } # Translate the module.info.LANG files local %minfo; if (&read_file("$m/module.info.zh_TW.Big5", \%minfo)) {