1. Zhang Huangbin
  2. iredadmin-ose

Commits

Zhang Huangbin  committed d220687

Update translations.

  • Participants
  • Parent commits 234d11c
  • Branches default

Comments (0)

Files changed (14)

File docs/HOWTO.i18n

View file
 *) Extract strings from templates:
 
     # cd /path/to/iredadmin-x.y.z/i18n/
-    # bash babel.sh extract
+    # bash translation.sh extract
 
 *) Translate '/path/to/iredadmin-x.y.z/i18n/iredadmin.po'.
 

File i18n/en_US/LC_MESSAGES/iredadmin.mo

Binary file modified.

File i18n/en_US/LC_MESSAGES/iredadmin.po

View file
 "Project-Id-Version: PROJECT VERSION\n"
 "Report-Msgid-Bugs-To: michaelbibby@gmail.com\n"
 "POT-Creation-Date: 2009-10-03 23:01+0800\n"
-"PO-Revision-Date: 2009-10-03 23:43+0800\n"
+"PO-Revision-Date: 2009-10-04 00:45+0800\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: en_US <LL@li.org>\n"
 "Plural-Forms: nplurals=2; plural=(n != 1)\n"
 msgstr ""
 
 #: ../templates/default/ldap/dashboard.html:44
-msgid "Admin type control (Global/Normal Admin)"
+msgid "Per-user mail forwarding control"
 msgstr ""
 
 #: ../templates/default/ldap/dashboard.html:45
 msgstr ""
 
 #: ../templates/default/ldap/dashboard.html:46
-msgid "Per-user MTA transport control"
+msgid "Admin type control (Global/Normal Admin)"
 msgstr ""
 
 #: ../templates/default/ldap/dashboard.html:56
 
 #: ../templates/default/ldap/error404.html:8
 #: ../templates/default/ldap/error404.html:14
-#, python-format
-msgid "Page not found (%s)."
+msgid "Page not found."
 msgstr ""
 
 #: ../templates/default/ldap/error404.html:8

File i18n/fr_FR/LC_MESSAGES/iredadmin.mo

Binary file modified.

File i18n/fr_FR/LC_MESSAGES/iredadmin.po

View file
 "Project-Id-Version: PROJECT VERSION\n"
 "Report-Msgid-Bugs-To: michaelbibby@gmail.com\n"
 "POT-Creation-Date: 2009-06-27 11:47+0800\n"
-"PO-Revision-Date: 2009-10-03 23:43+0800\n"
+"PO-Revision-Date: 2009-10-04 00:45+0800\n"
 "Last-Translator: Mael LE SAOUT <mael.lesaout@gmail.com>\n"
 "Language-Team: fr_FR <LL@li.org>\n"
 "Plural-Forms: nplurals=2; plural=(n > 1)\n"
 msgstr "Nombre maximum d'alias de messagerie"
 
 #: ../templates/default/ldap/dashboard.html:44
-msgid "Admin type control (Global/Normal Admin)"
+msgid "Per-user mail forwarding control"
 msgstr ""
 
 #: ../templates/default/ldap/dashboard.html:45
 msgstr ""
 
 #: ../templates/default/ldap/dashboard.html:46
-msgid "Per-user MTA transport control"
+msgid "Admin type control (Global/Normal Admin)"
 msgstr ""
 
 #: ../templates/default/ldap/dashboard.html:56
 
 #: ../templates/default/ldap/error404.html:8
 #: ../templates/default/ldap/error404.html:14
-#, fuzzy, python-format
-msgid "Page not found (%s)."
+#, fuzzy
+msgid "Page not found."
 msgstr "Page introuvable."
 
 #: ../templates/default/ldap/error404.html:8

File i18n/iredadmin.po

View file
 msgstr ""
 "Project-Id-Version: PROJECT VERSION\n"
 "Report-Msgid-Bugs-To: michaelbibby@gmail.com\n"
-"POT-Creation-Date: 2009-10-03 23:43+0800\n"
+"POT-Creation-Date: 2009-10-04 00:45+0800\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
 msgstr ""
 
 #: ../templates/default/ldap/dashboard.html:44
-msgid "Admin type control (Global/Normal Admin)"
+msgid "Per-user mail forwarding control"
 msgstr ""
 
 #: ../templates/default/ldap/dashboard.html:45
 msgstr ""
 
 #: ../templates/default/ldap/dashboard.html:46
-msgid "Per-user MTA transport control"
+msgid "Admin type control (Global/Normal Admin)"
 msgstr ""
 
 #: ../templates/default/ldap/dashboard.html:56
 
 #: ../templates/default/ldap/error404.html:8
 #: ../templates/default/ldap/error404.html:14
-#, python-format
-msgid "Page not found (%s)."
+msgid "Page not found."
 msgstr ""
 
 #: ../templates/default/ldap/error404.html:8

File i18n/msgfmt.py

View file
+#! /usr/bin/env python
+# -*- coding: iso-8859-1 -*-
+# Written by Martin v. L�wis <loewis@informatik.hu-berlin.de>
+
+"""Generate binary message catalog from textual translation description.
+
+This program converts a textual Uniforum-style message catalog (.po file) into
+a binary GNU catalog (.mo file).  This is essentially the same function as the
+GNU msgfmt program, however, it is a simpler implementation.
+
+Usage: msgfmt.py [OPTIONS] filename.po
+
+Options:
+    -o file
+    --output-file=file
+        Specify the output file to write to.  If omitted, output will go to a
+        file named filename.mo (based off the input file name).
+
+    -h
+    --help
+        Print this message and exit.
+
+    -V
+    --version
+        Display version information and exit.
+"""
+
+import sys
+import os
+import getopt
+import struct
+import array
+
+__version__ = "1.1"
+
+MESSAGES = {}
+
+
+
+def usage(code, msg=''):
+    print >> sys.stderr, __doc__
+    if msg:
+        print >> sys.stderr, msg
+    sys.exit(code)
+
+
+
+def add(id, str, fuzzy):
+    "Add a non-fuzzy translation to the dictionary."
+    global MESSAGES
+    if not fuzzy and str:
+        MESSAGES[id] = str
+
+
+
+def generate():
+    "Return the generated output."
+    global MESSAGES
+    keys = MESSAGES.keys()
+    # the keys are sorted in the .mo file
+    keys.sort()
+    offsets = []
+    ids = strs = ''
+    for id in keys:
+        # For each string, we need size and file offset.  Each string is NUL
+        # terminated; the NUL does not count into the size.
+        offsets.append((len(ids), len(id), len(strs), len(MESSAGES[id])))
+        ids += id + '\0'
+        strs += MESSAGES[id] + '\0'
+    output = ''
+    # The header is 7 32-bit unsigned integers.  We don't use hash tables, so
+    # the keys start right after the index tables.
+    # translated string.
+    keystart = 7*4+16*len(keys)
+    # and the values start after the keys
+    valuestart = keystart + len(ids)
+    koffsets = []
+    voffsets = []
+    # The string table first has the list of keys, then the list of values.
+    # Each entry has first the size of the string, then the file offset.
+    for o1, l1, o2, l2 in offsets:
+        koffsets += [l1, o1+keystart]
+        voffsets += [l2, o2+valuestart]
+    offsets = koffsets + voffsets
+    output = struct.pack("Iiiiiii",
+                         0x950412deL,       # Magic
+                         0,                 # Version
+                         len(keys),         # # of entries
+                         7*4,               # start of key index
+                         7*4+len(keys)*8,   # start of value index
+                         0, 0)              # size and offset of hash table
+    output += array.array("i", offsets).tostring()
+    output += ids
+    output += strs
+    return output
+
+
+
+def make(filename, outfile):
+    ID = 1
+    STR = 2
+
+    # Compute .mo name from .po name and arguments
+    if filename.endswith('.po'):
+        infile = filename
+    else:
+        infile = filename + '.po'
+    if outfile is None:
+        outfile = os.path.splitext(infile)[0] + '.mo'
+
+    try:
+        lines = open(infile).readlines()
+    except IOError, msg:
+        print >> sys.stderr, msg
+        sys.exit(1)
+
+    section = None
+    fuzzy = 0
+
+    # Parse the catalog
+    lno = 0
+    for l in lines:
+        lno += 1
+        # If we get a comment line after a msgstr, this is a new entry
+        if l[0] == '#' and section == STR:
+            add(msgid, msgstr, fuzzy)
+            section = None
+            fuzzy = 0
+        # Record a fuzzy mark
+        if l[:2] == '#,' and 'fuzzy' in l:
+            fuzzy = 1
+        # Skip comments
+        if l[0] == '#':
+            continue
+        # Now we are in a msgid section, output previous section
+        if l.startswith('msgid'):
+            if section == STR:
+                add(msgid, msgstr, fuzzy)
+            section = ID
+            l = l[5:]
+            msgid = msgstr = ''
+        # Now we are in a msgstr section
+        elif l.startswith('msgstr'):
+            section = STR
+            l = l[6:]
+        # Skip empty lines
+        l = l.strip()
+        if not l:
+            continue
+        # XXX: Does this always follow Python escape semantics?
+        l = eval(l)
+        if section == ID:
+            msgid += l
+        elif section == STR:
+            msgstr += l
+        else:
+            print >> sys.stderr, 'Syntax error on %s:%d' % (infile, lno), \
+                  'before:'
+            print >> sys.stderr, l
+            sys.exit(1)
+    # Add last entry
+    if section == STR:
+        add(msgid, msgstr, fuzzy)
+
+    # Compute output
+    output = generate()
+
+    try:
+        open(outfile,"wb").write(output)
+    except IOError,msg:
+        print >> sys.stderr, msg
+
+
+
+def main():
+    try:
+        opts, args = getopt.getopt(sys.argv[1:], 'hVo:',
+                                   ['help', 'version', 'output-file='])
+    except getopt.error, msg:
+        usage(1, msg)
+
+    outfile = None
+    # parse options
+    for opt, arg in opts:
+        if opt in ('-h', '--help'):
+            usage(0)
+        elif opt in ('-V', '--version'):
+            print >> sys.stderr, "msgfmt.py", __version__
+            sys.exit(0)
+        elif opt in ('-o', '--output-file'):
+            outfile = arg
+    # do it
+    if not args:
+        print >> sys.stderr, 'No input file given'
+        print >> sys.stderr, "Try `msgfmt --help' for more information."
+        return
+
+    for filename in args:
+        make(filename, outfile)
+
+
+if __name__ == '__main__':
+    main()

File i18n/translation.sh

View file
             -l ${lang}
     done
 
-elif [ X"${ACTION}" == X"compile" ]; then
-    echo "* Compile translation catalogs into binary MO files..."
+elif [ X"${ACTION}" == X"convert" ]; then
+    echo "* Convert translation catalogs into binary MO files..."
     for lang in ${AVAILABLE_LANGS}
     do
-        pybabel compile -f -i ${POFILE} \
-            -D ${DOMAIN} \
-            -d . \
-            -l ${lang}
+        echo "  + Converting ${lang}..."
+        python ./msgfmt.py ${lang}/LC_MESSAGES/${DOMAIN}.po
     done
 elif [ X"${ACTION}" == X"all" ]; then
     bash $0 extract && \
     bash $0 update && \
-    bash $0 compile
+    bash $0 convert
 else
     :
 fi

File i18n/vi_VN/LC_MESSAGES/iredadmin.mo

Binary file modified.

File i18n/vi_VN/LC_MESSAGES/iredadmin.po

View file
 "Project-Id-Version: PROJECT VERSION\n"
 "Report-Msgid-Bugs-To: michaelbibby@gmail.com\n"
 "POT-Creation-Date: 2009-10-02 01:16+0800\n"
-"PO-Revision-Date: 2009-10-03 23:43+0800\n"
+"PO-Revision-Date: 2009-10-04 00:45+0800\n"
 "Last-Translator: Lâm Minh Thông <lmthong@gmail.com>\n"
 "Language-Team: vi_VN <LL@li.org>\n"
 "Plural-Forms: nplurals=1; plural=0\n"
 msgstr ""
 
 #: ../templates/default/ldap/dashboard.html:44
-msgid "Admin type control (Global/Normal Admin)"
+msgid "Per-user mail forwarding control"
 msgstr ""
 
 #: ../templates/default/ldap/dashboard.html:45
 msgstr ""
 
 #: ../templates/default/ldap/dashboard.html:46
-msgid "Per-user MTA transport control"
+msgid "Admin type control (Global/Normal Admin)"
 msgstr ""
 
 #: ../templates/default/ldap/dashboard.html:56
 
 #: ../templates/default/ldap/error404.html:8
 #: ../templates/default/ldap/error404.html:14
-#, python-format
-msgid "Page not found (%s)."
+#, fuzzy
+msgid "Page not found."
 msgstr "Không tìm thấy trang (%s)."
 
 #: ../templates/default/ldap/error404.html:8

File i18n/zh_CN/LC_MESSAGES/iredadmin.mo

Binary file modified.

File i18n/zh_CN/LC_MESSAGES/iredadmin.po

View file
 # This file is distributed under the same license as the PROJECT project.
 # FIRST AUTHOR <EMAIL@ADDRESS>, 2009.
 #
-#, fuzzy
 msgid ""
 msgstr ""
 "Project-Id-Version: PROJECT VERSION\n"
 "Report-Msgid-Bugs-To: michaelbibby@gmail.com\n"
 "POT-Creation-Date: 2009-06-26 11:33+0400\n"
-"PO-Revision-Date: 2009-10-03 23:43+0800\n"
+"PO-Revision-Date: 2009-10-04 00:45+0800\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
-"Language-Team: zh_CN <LL@li.org>\n"
+"Language-Team: zh_CN <michaelbibby@gmail.com>\n"
 "Plural-Forms: nplurals=1; plural=0\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=utf-8\n"
 
 #: ../templates/default/ldap/admin_profile.html:42
 msgid "You are NOT permited to view/update other's profile."
-msgstr "不允许查看/更新他人的属性。"
+msgstr "不允许查看更新他人的偏好设置。"
 
 #: ../templates/default/ldap/admin_profile.html:45
 msgid "Current password is incorrect."
 #: ../templates/default/ldap/user_profile.html:100
 #: ../templates/default/ldap/user_profile.html:101
 msgid ":"
-msgstr ""
+msgstr ""
 
 #: ../templates/default/ldap/admin_profile.html:70
 #: ../templates/default/ldap/admins.html:47
 msgstr "保存更改"
 
 #: ../templates/default/ldap/admins.html:5
-#, fuzzy
 msgid "Domain Admins"
 msgstr "域管理员"
 
 
 #: ../templates/default/ldap/admins.html:21
 #: ../templates/default/ldap/users.html:36
-#, fuzzy
 msgid "Selected accounts were deleted."
 msgstr "没有选择帐号。"
 
 #: ../templates/default/ldap/admins.html:23
 #: ../templates/default/ldap/users.html:38
 msgid "Selected accounts were disabled."
-msgstr ""
+msgstr "选定的帐号已禁用。"
 
 #: ../templates/default/ldap/admins.html:25
 #: ../templates/default/ldap/users.html:40
 msgid "Selected accounts were enabled."
-msgstr ""
+msgstr "选定的帐号已启用。"
 
 #: ../templates/default/ldap/admins.html:29
 msgid "No account selected."
-msgstr "没有选帐号。"
+msgstr "没有选帐号。"
 
 #: ../templates/default/ldap/admins.html:49
 msgid "Global Admin"
-msgstr "局管理员"
+msgstr "局管理员"
 
 #: ../templates/default/ldap/admins.html:71
 msgid "Edit admin profile."
 #: ../templates/default/ldap/admins.html:86
 #: ../templates/default/ldap/domains.html:65
 #: ../templates/default/ldap/users.html:113
-#, fuzzy
 msgid "Disable"
 msgstr "禁用"
 
 #: ../templates/default/ldap/admins.html:86
 #: ../templates/default/ldap/users.html:113
-#, fuzzy
 msgid "Are you sure want to disable selected account(s)?"
 msgstr "您确定要删除选中的帐号吗?"
 
 #: ../templates/default/ldap/admins.html:87
 #: ../templates/default/ldap/domains.html:66
 #: ../templates/default/ldap/users.html:114
-#, fuzzy
 msgid "Enable"
 msgstr "启用"
 
 #: ../templates/default/ldap/admins.html:87
 #: ../templates/default/ldap/users.html:114
-#, fuzzy
 msgid "Are you sure want to enable selected account(s)?"
 msgstr "您确定要删除选中的帐号吗?"
 
 
 #: ../templates/default/ldap/dashboard.html:36
 msgid "Need more features?"
-msgstr ""
+msgstr "需要更多功能?"
 
 #: ../templates/default/ldap/dashboard.html:38
 msgid ""
 "Purchase Full-featured Edition to get more features and support iRedMail "
 "project."
-msgstr ""
+msgstr "购买全功能的版本以获取更多功能并支持 iRedMail 项目。"
 
 #: ../templates/default/ldap/dashboard.html:39
 msgid "For example:"
-msgstr ""
+msgstr "例如:"
 
 #: ../templates/default/ldap/dashboard.html:42
 msgid "Unlimited number of mail lists"
-msgstr ""
+msgstr "无限数量的的邮件列表"
 
 #: ../templates/default/ldap/dashboard.html:43
 msgid "Unlimited number of mail aliases"
-msgstr ""
+msgstr "无限数量的邮件别名(alias)"
 
 #: ../templates/default/ldap/dashboard.html:44
-msgid "Admin type control (Global/Normal Admin)"
-msgstr ""
+msgid "Per-user mail forwarding control"
+msgstr "针对单个用户的邮件转发控制"
 
 #: ../templates/default/ldap/dashboard.html:45
 msgid "Per-user service control"
-msgstr ""
+msgstr "针对单个用户的服务控制"
 
 #: ../templates/default/ldap/dashboard.html:46
-msgid "Per-user MTA transport control"
-msgstr ""
+msgid "Admin type control (Global/Normal Admin)"
+msgstr "管理员类型控制(全局、普通管理员)"
 
 #: ../templates/default/ldap/dashboard.html:56
 msgid "System info"
 msgstr "域名"
 
 #: ../templates/default/ldap/domain_profile.html:16
-#, fuzzy
 msgid "Edit domain profile."
 msgstr "编辑域属性"
 
 msgstr "您确定要删除选中的域和域内的用户吗?"
 
 #: ../templates/default/ldap/domains.html:65
-#, fuzzy
 msgid "Are you sure want to disable selected domain(s)?"
 msgstr "您确定要删除选中的帐号吗?"
 
 #: ../templates/default/ldap/domains.html:66
-#, fuzzy
 msgid "Are you sure want to enable selected domain(s)?"
 msgstr "您确定要删除选中的帐号吗?"
 
 #: ../templates/default/ldap/error404.html:8
 #: ../templates/default/ldap/error404.html:14
-#, fuzzy, python-format
-msgid "Page not found (%s)."
+#, fuzzy
+msgid "Page not found."
 msgstr "页面未找到。"
 
 #: ../templates/default/ldap/error404.html:8
 msgstr "iRedMail 管理平台"
 
 #: ../templates/default/ldap/layout.html:87
-#, fuzzy
 msgid "Domains"
 msgstr "管理员"
 
 msgstr "验证失败。"
 
 #: ../templates/default/ldap/login.html:55
-#, fuzzy
 msgid ""
 "All fields labelled <strong><em>(Required)</em></strong> must be "
 "completed before the form is submitted."
 msgstr "用户名"
 
 #: ../templates/default/ldap/login.html:62
-#, fuzzy
 msgid "Must be a valid domain admin email address."
 msgstr "必须是有效的邮件地址。"
 
 msgstr "默认语言"
 
 #: ../templates/default/ldap/macros.html:101
-#, fuzzy
 msgid "Enable this domain"
 msgstr "选择一个域"
 
 #: ../templates/default/ldap/macros.html:103
 msgid "Enable this account"
-msgstr ""
+msgstr "启用这个帐号"
 
 #: ../templates/default/ldap/macros.html:114
 #: ../templates/default/ldap/macros.html:116
 
 #: ../templates/default/ldap/msgHandlers.html:5
 msgid "Domain was created."
-msgstr ""
+msgstr "邮件域已成功创建。"
 
 #: ../templates/default/ldap/msgHandlers.html:9
 msgid "Selected domains were deleted."
-msgstr ""
+msgstr "已删除选定的域。"
 
 #: ../templates/default/ldap/msgHandlers.html:11
 msgid "Selected domains were diabled."
-msgstr ""
+msgstr "已禁用选定的域。"
 
 #: ../templates/default/ldap/msgHandlers.html:13
 msgid "Selected domains were enabled."
-msgstr ""
+msgstr "已启用选定的域。"
 
 #: ../templates/default/ldap/msgHandlers.html:17
 msgid "Domain name is empty."
-msgstr ""
+msgstr "域名为空。"
 
 #: ../templates/default/ldap/msgHandlers.html:19
 msgid "Server-side size limit exceeded."
 
 #: ../templates/default/ldap/msgHandlers.html:21
 msgid "Permission denied."
-msgstr ""
+msgstr "拒绝访问。"
 
 #: ../templates/default/ldap/msgHandlers.html:23
 msgid "No such domain."
 
 #: ../templates/default/ldap/msgHandlers.html:25
 msgid "Incorrect profile type."
-msgstr ""
+msgstr "错误的偏好类型。"
 
 #: ../templates/default/ldap/msgHandlers.html:27
 msgid "Submited domain name is incorrect."
-msgstr ""
+msgstr "提交的域名不正确。"
 
 #: ../templates/default/ldap/user_create.html:14
 #: ../templates/default/ldap/user_create.html:19
 
 #: ../templates/default/ldap/user_create.html:27
 msgid "Account already exists, please choose another username."
-msgstr ""
+msgstr "帐号已存在,请选择另外一个用户名。"
 
 #: ../templates/default/ldap/user_profile.html:19
 #: ../templates/default/ldap/users.html:92
 msgstr "编辑用户属性"
 
 #: ../templates/default/ldap/user_profile.html:27
-#, fuzzy
 msgid "Reset Password"
 msgstr "重置密码"
 
 msgstr "选择一个域"
 
 #: ../templates/default/ldap/users.html:27
-#, fuzzy
 msgid "View/Update domain profile"
 msgstr "编辑域属性"
 
 #: ../templates/default/ldap/users.html:44
 #, python-format
 msgid "Invalid profile type: %s."
-msgstr ""
+msgstr "无效的偏好类型:%s。"
 
 #: ../templates/default/ldap/users.html:46
-#, fuzzy
 msgid "No mail domain available."
 msgstr "暂无头像"
 

File templates/default/ldap/dashboard.html

View file
                 <ul class="data-list">
                     <li><span>* {{ _('Unlimited number of mail lists') }}</span></li>
                     <li><span>* {{ _('Unlimited number of mail aliases') }}</span></li>
+                    <li><span>* {{ _('Per-user mail forwarding control') }}</span></li>
+                    <li><span>* {{ _('Per-user service control') }}</span></li>
                     <li><span>* {{ _('Admin type control (Global/Normal Admin)') }}</span></li>
-                    <li><span>* {{ _('Per-user service control') }}</span></li>
-                    <li><span>* {{ _('Per-user MTA transport control') }}</span></li>
                 </ul>
             </div>
         </div>

File templates/default/ldap/error404.html

View file
 {% block jquery_docoment_ready %}{% endblock jquery_docoment_ready %}
 
 {% block title %}
-    {{ _('Error:') }}&nbsp;{{ _('Page not found (%s).') |format(ctx.path) }}
+    {{ _('Error:') }} {{ _('Page not found.') }}
 {% endblock title %}
 
 {% block main %}
 <div class="ct-box info-box">
     <div class="error">
-        <span class="important"><strong>{{ _('Error:') }}</strong> {{ _('Page not found (%s).') |format(ctx.path) }}</span>
+        <span class="important"><strong>{{ _('Error:') }}</strong> {{ _('Page not found.') }} ({{ctx.fullpath}})</span>
     </div>
 </div>
 {% endblock main %}