From f2f16a1018031a5f08b5b395f851c14b3f492be3 Mon Sep 17 00:00:00 2001 From: WrinklyNinja Date: Tue, 4 Feb 2014 23:23:13 +0000 Subject: [PATCH] Updated packaging scripts to include Chinese translation. --- src/archive.py | 15 ++++++--------- src/installer.nsi | 24 ++++++++++++------------ 2 files changed, 18 insertions(+), 21 deletions(-) diff --git a/src/archive.py b/src/archive.py index 510ed059..6b85bd08 100644 --- a/src/archive.py +++ b/src/archive.py @@ -12,6 +12,8 @@ # resources/l10n/ru/LC_MESSAGES/wxstd.mo # resources/l10n/fr/LC_MESSAGES/boss.mo # resources/l10n/fr/LC_MESSAGES/wxstd.mo +# resources/l10n/zh/LC_MESSAGES/boss.mo +# resources/l10n/zh/LC_MESSAGES/wxstd.mo # resources/polyfill.js # resources/script.js # resources/style.css @@ -61,15 +63,10 @@ if not os.path.exists(temp_path): # Now copy everything into the temporary folder. shutil.copy( os.path.join('..', 'build', 'BOSS.exe'), temp_path ) -os.makedirs(os.path.join(temp_path, 'resources', 'l10n', 'es', 'LC_MESSAGES')) -os.makedirs(os.path.join(temp_path, 'resources', 'l10n', 'ru', 'LC_MESSAGES')) -os.makedirs(os.path.join(temp_path, 'resources', 'l10n', 'fr', 'LC_MESSAGES')) -shutil.copy( os.path.join('..', 'resources', 'l10n', 'es', 'LC_MESSAGES', 'boss.mo'), os.path.join(temp_path, 'resources', 'l10n', 'es', 'LC_MESSAGES') ) -shutil.copy( os.path.join('..', 'resources', 'l10n', 'es', 'LC_MESSAGES', 'wxstd.mo'), os.path.join(temp_path, 'resources', 'l10n', 'es', 'LC_MESSAGES') ) -shutil.copy( os.path.join('..', 'resources', 'l10n', 'ru', 'LC_MESSAGES', 'boss.mo'), os.path.join(temp_path, 'resources', 'l10n', 'ru', 'LC_MESSAGES') ) -shutil.copy( os.path.join('..', 'resources', 'l10n', 'ru', 'LC_MESSAGES', 'wxstd.mo'), os.path.join(temp_path, 'resources', 'l10n', 'ru', 'LC_MESSAGES') ) -shutil.copy( os.path.join('..', 'resources', 'l10n', 'fr', 'LC_MESSAGES', 'boss.mo'), os.path.join(temp_path, 'resources', 'l10n', 'fr', 'LC_MESSAGES') ) -shutil.copy( os.path.join('..', 'resources', 'l10n', 'fr', 'LC_MESSAGES', 'wxstd.mo'), os.path.join(temp_path, 'resources', 'l10n', 'fr', 'LC_MESSAGES') ) +for lang in ['es', 'ru', 'fr', 'zh']: + os.makedirs(os.path.join(temp_path, 'resources', 'l10n', lang, 'LC_MESSAGES')) + shutil.copy( os.path.join('..', 'resources', 'l10n', lang, 'LC_MESSAGES', 'boss.mo'), os.path.join(temp_path, 'resources', 'l10n', lang, 'LC_MESSAGES') ) + shutil.copy( os.path.join('..', 'resources', 'l10n', lang, 'LC_MESSAGES', 'wxstd.mo'), os.path.join(temp_path, 'resources', 'l10n', lang, 'LC_MESSAGES') ) shutil.copy( os.path.join('..', 'resources', 'polyfill.js'), os.path.join(temp_path, 'resources') ) diff --git a/src/installer.nsi b/src/installer.nsi index 349669eb..8ac61b0b 100644 --- a/src/installer.nsi +++ b/src/installer.nsi @@ -294,9 +294,9 @@ FunctionEnd File "..\resources\l10n\es\LC_MESSAGES\boss.mo" ;SetOutPath "$INSTDIR\resources\l10n\de\LC_MESSAGES" ;File "..\resources\l10n\de\LC_MESSAGES\wxstd.mo" - ;SetOutPath "$INSTDIR\resources\l10n\zh\LC_MESSAGES" - ;File "..\resources\l10n\zh\LC_MESSAGES\boss.mo" - ;File "..\resources\l10n\zh\LC_MESSAGES\wxstd.mo" + SetOutPath "$INSTDIR\resources\l10n\zh\LC_MESSAGES" + File "..\resources\l10n\zh\LC_MESSAGES\boss.mo" + File "..\resources\l10n\zh\LC_MESSAGES\wxstd.mo" SetOutPath "$INSTDIR\resources\l10n\fr\LC_MESSAGES" File "..\resources\l10n\fr\LC_MESSAGES\wxstd.mo" File "..\resources\l10n\fr\LC_MESSAGES\boss.mo" @@ -321,11 +321,11 @@ FunctionEnd Push "Language:" Push "Language: spa" Call ReplaceLineStr - ;StrCmp $LANGUAGE ${LANG_SIMPCHINESE} 0 +5 - ; Push "$LOCALAPPDATA\BOSS\settings.yaml" - ; Push "Language:" - ; Push "Language: cmn" - ; Call ReplaceLineStr + StrCmp $LANGUAGE ${LANG_SIMPCHINESE} 0 +5 + Push "$LOCALAPPDATA\BOSS\settings.yaml" + Push "Language:" + Push "Language: zho" + Call ReplaceLineStr StrCmp $LANGUAGE ${LANG_FRENCH} 0 +5 Push "$LOCALAPPDATA\BOSS\settings.yaml" Push "Language:" @@ -396,8 +396,8 @@ FunctionEnd Delete "$INSTDIR\resources\l10n\es\LC_MESSAGES\boss.mo" Delete "$INSTDIR\resources\l10n\es\LC_MESSAGES\wxstd.mo" ;Delete "$INSTDIR\resources\l10n\de\LC_MESSAGES\wxstd.mo" - ;Delete "$INSTDIR\resources\l10n\zh\LC_MESSAGES\boss.mo" - ;Delete "$INSTDIR\resources\l10n\zh\LC_MESSAGES\wxstd.mo" + Delete "$INSTDIR\resources\l10n\zh\LC_MESSAGES\boss.mo" + Delete "$INSTDIR\resources\l10n\zh\LC_MESSAGES\wxstd.mo" Delete "$INSTDIR\resources\l10n\fr\LC_MESSAGES\boss.mo" Delete "$INSTDIR\resources\l10n\fr\LC_MESSAGES\wxstd.mo" RMDir "$INSTDIR\resources\l10n\ru\LC_MESSAGES" @@ -406,8 +406,8 @@ FunctionEnd RMDir "$INSTDIR\resources\l10n\es" ;RMDir "$INSTDIR\resources\l10n\de\LC_MESSAGES" ;RMDir "$INSTDIR\resources\l10n\de" - ;RMDir "$INSTDIR\resources\l10n\zh\LC_MESSAGES" - ;RMDir "$INSTDIR\resources\l10n\zh" + RMDir "$INSTDIR\resources\l10n\zh\LC_MESSAGES" + RMDir "$INSTDIR\resources\l10n\zh" RMDir "$INSTDIR\resources\l10n\fr\LC_MESSAGES" RMDir "$INSTDIR\resources\l10n\fr" RMDir "$INSTDIR\resources\l10n"