diff --git a/.gitignore b/.gitignore index 28e31a613e..2f04a9dd53 100644 --- a/.gitignore +++ b/.gitignore @@ -16,3 +16,4 @@ secret_key.py run-seahub.sh setenv.sh .DS_Store +*.mo diff --git a/avatar/locale/de/LC_MESSAGES/django.mo b/avatar/locale/de/LC_MESSAGES/django.mo deleted file mode 100644 index 28e79ca56b..0000000000 Binary files a/avatar/locale/de/LC_MESSAGES/django.mo and /dev/null differ diff --git a/avatar/locale/fr/LC_MESSAGES/django.mo b/avatar/locale/fr/LC_MESSAGES/django.mo deleted file mode 100644 index 2abb9798e3..0000000000 Binary files a/avatar/locale/fr/LC_MESSAGES/django.mo and /dev/null differ diff --git a/avatar/locale/pt_BR/LC_MESSAGES/django.mo b/avatar/locale/pt_BR/LC_MESSAGES/django.mo deleted file mode 100644 index 7a17848561..0000000000 Binary files a/avatar/locale/pt_BR/LC_MESSAGES/django.mo and /dev/null differ diff --git a/avatar/locale/zh_CN/LC_MESSAGES/django.mo b/avatar/locale/zh_CN/LC_MESSAGES/django.mo deleted file mode 100644 index f8deb01108..0000000000 Binary files a/avatar/locale/zh_CN/LC_MESSAGES/django.mo and /dev/null differ diff --git a/base/locale/zh_CN/LC_MESSAGES/django.mo b/base/locale/zh_CN/LC_MESSAGES/django.mo deleted file mode 100644 index 6b7ac2f999..0000000000 Binary files a/base/locale/zh_CN/LC_MESSAGES/django.mo and /dev/null differ diff --git a/contacts/locale/zh_CN/LC_MESSAGES/django.mo b/contacts/locale/zh_CN/LC_MESSAGES/django.mo deleted file mode 100644 index 41d32efa1b..0000000000 Binary files a/contacts/locale/zh_CN/LC_MESSAGES/django.mo and /dev/null differ diff --git a/group/locale/zh_CN/LC_MESSAGES/django.mo b/group/locale/zh_CN/LC_MESSAGES/django.mo deleted file mode 100644 index c8bf746dc5..0000000000 Binary files a/group/locale/zh_CN/LC_MESSAGES/django.mo and /dev/null differ diff --git a/i18n.sh b/i18n.sh new file mode 100755 index 0000000000..7eae0bc981 --- /dev/null +++ b/i18n.sh @@ -0,0 +1,115 @@ +#!/bin/bash + +function usage () { + echo "usage: $0 " + echo + echo " update update po of this app" + echo " update seahub update po of seahub" + echo " update-all update po of all apps" + echo " compile compile po file of this app" + echo " compile seahub compile po file of seahub" + echo " compile-all compile po files of all apps" + echo +} + +apps="avatar base contacts group notifications organizations profile share" +function is_valid_app() { + for app in ${apps}; do + if [[ $1 == $app ]]; then + return 0; + fi + done + + return 1 +} + +# On some systems django-admin.py is only django-admin +if which django-admin.py 2>/dev/null 1>&2; then + django_admin=django-admin.py +elif which django-admin 2>/dev/null 1>&2; then + django_admin=django-admin +else + echo "ERROR: django-admin script not found" + exit 1 +fi + +# check args +if [[ $# == 0 ]]; then + usage; + exit 1; +fi + +if [[ $1 == "-h" || $1 == "--help" || $1 == "help" ]]; then + usage; + exit 0; +fi + +if [[ $1 != "update" && $1 != "update-all" && $1 != "compile" && $1 != "compile-all" ]]; then + usage; + exit 1; +fi + +if [[ $1 == "update" || $1 == "compile" ]]; then + if [[ $# != 2 ]]; then + usage; + exit 1; + fi + + if ! is_valid_app $2; then + echo "\"$2\" is not a valid app name"; + exit 1 + fi +fi + +case $1 in + update) + printf "\033[1;32m[i18n]\033[m >>>>> update po of $2 <<<<<\n" + if [[ $2 == "seahub" ]]; then + ${django_admin} makemessages -l zh_CN -e py,html \ + -i "thirdpart*" -i "api*" -i "avatar*" -i "base*" \ + -i "contacts*" -i "group*" -i "notifications*" -i "organizations*" \ + -i "profile*" -i "share*" -i "media*" + else + pushd $2 2>/dev/null 1>&2 + ${django_admin} makemessages -l zh_CN -e py,html + popd 2>/dev/null 1>&2 + fi + ;; + update-all) + printf "\033[1;32m[i18n]\033[m >>>>> update po of seahub <<<<<\n" + ${django_admin} makemessages -l zh_CN -e py,html \ + -i "thirdpart*" -i "api*" -i "avatar*" -i "base*" \ + -i "contacts*" -i "group*" -i "notifications*" -i "organizations*" \ + -i "profile*" -i "share*" -i "media*" + for app in ${apps}; do + printf "\033[1;32m[i18n]\033[m >>>>> update po of ${app} <<<<<\n" + pushd ${app} 2>/dev/null 1>&2 + ${django_admin} makemessages -l zh_CN -e py,html + popd 2>/dev/null 1>&2 + done + ;; + compile) + printf "\033[1;32m[i18n]\033[m >>>>> compile po of $2 <<<<<\n" + if [[ $2 == "seahub" ]]; then + ${django_admin} compilemessages + else + pushd $2 + ${django_admin} compilemessages + popd + fi + ;; + compile-all) + printf "\033[1;32m[i18n]\033[m >>>>> compile po of seahub <<<<<\n" + ${django_admin} compilemessages + apps="avatar base contacts group notifications organizations profile share" + for app in ${apps}; do + printf "\033[1;32m[i18n]\033[m >>>>> compile po of ${app} <<<<<\n" + pushd ${app} 2>/dev/null 1>&2 + ${django_admin} compilemessages + popd + done + ;; +esac + +echo Done +echo diff --git a/i18n.sh.template b/i18n.sh.template deleted file mode 100755 index 48332ff0d1..0000000000 --- a/i18n.sh.template +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh - -# Ignore all apps - -# .py and .html i18n -django-admin.py makemessages -l zh_CN -e py,html -i "thirdpart*" -i "api*" -i "avatar*" -i "base*" -i "contacts*" -i "group*" -i "notifications*" -i "organizations*" -i "profile*" -i "share*" -i "media*" - -# js i18n -# django-admin.py makemessages -d djangojs -l zh_CN -i "thirdpart*" -i "api*" -i "avatar*" -i "base*" -i "contacts*" -i "group*" -i "notifications*" -i "organizations*" -i "profile*" -i "share*" -i "media*" - -django-admin.py compilemessages diff --git a/locale/zh_CN/LC_MESSAGES/django.mo b/locale/zh_CN/LC_MESSAGES/django.mo deleted file mode 100644 index 639214fdde..0000000000 Binary files a/locale/zh_CN/LC_MESSAGES/django.mo and /dev/null differ diff --git a/locale/zh_CN/LC_MESSAGES/django.po b/locale/zh_CN/LC_MESSAGES/django.po index 286ab2f6f1..3bad5e39df 100644 --- a/locale/zh_CN/LC_MESSAGES/django.po +++ b/locale/zh_CN/LC_MESSAGES/django.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2012-11-05 17:47+0800\n" +"POT-Creation-Date: 2012-11-06 10:43+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -1206,14 +1206,18 @@ msgid "Really want to restore this library?" msgstr "确定要还原这个资料库?" #: templates/seafile_access_check.html:6 +msgid "Preparing, please wait..." +msgstr "处理中,请稍候..." + +#: templates/seafile_access_check.html:7 msgid "Make sure Seafile client is running." msgstr "请确认本地Seafile程序已启动。" -#: templates/seafile_access_check.html:7 +#: templates/seafile_access_check.html:8 msgid "Your Seafile client is out of date, please upgrade to latest version." msgstr "你的 Seafile 客户端版本太旧,请升级到最新版本。" -#: templates/seafile_access_check.html:7 +#: templates/seafile_access_check.html:8 msgid "Click to download." msgstr "点此下载" diff --git a/notifications/locale/zh_CN/LC_MESSAGES/django.mo b/notifications/locale/zh_CN/LC_MESSAGES/django.mo deleted file mode 100644 index 35bea692d0..0000000000 Binary files a/notifications/locale/zh_CN/LC_MESSAGES/django.mo and /dev/null differ diff --git a/organizations/locale/zh_CN/LC_MESSAGES/django.mo b/organizations/locale/zh_CN/LC_MESSAGES/django.mo deleted file mode 100644 index aa2eb68f21..0000000000 Binary files a/organizations/locale/zh_CN/LC_MESSAGES/django.mo and /dev/null differ diff --git a/profile/locale/zh_CN/LC_MESSAGES/django.mo b/profile/locale/zh_CN/LC_MESSAGES/django.mo deleted file mode 100644 index 546882e683..0000000000 Binary files a/profile/locale/zh_CN/LC_MESSAGES/django.mo and /dev/null differ diff --git a/share/locale/zh_CN/LC_MESSAGES/django.mo b/share/locale/zh_CN/LC_MESSAGES/django.mo deleted file mode 100644 index a7b44a4c66..0000000000 Binary files a/share/locale/zh_CN/LC_MESSAGES/django.mo and /dev/null differ diff --git a/templates/seafile_access_check.html b/templates/seafile_access_check.html index fa43ca6812..f1ef805a52 100644 --- a/templates/seafile_access_check.html +++ b/templates/seafile_access_check.html @@ -3,6 +3,7 @@ {% block main_panel %}
+

{% trans 'Preparing, please wait...' %}

{% trans "Make sure Seafile client is running." %}

{% trans "Your Seafile client is out of date, please upgrade to latest version." %}{% trans "Click to download." %}

@@ -29,6 +30,7 @@ $(function() { }); setTimeout(function() { + $('#msg-wait').addClass('hide'); if (version_mismatch) { $('#msg-version').removeClass('hide'); } else if (!req_success) {