[IMP] refactored translation system to merge web translations with addons translations

- Moved the web *.po files to /i18n to be consistent
  with the addons convention. Using /po was considered
  for a while because it played better with LP's auto-
  detection of PO Templates, but that is not necessary
  anymore, we now have full control on LP templates.

- In order to support addons that contain translations
  for both the web addon and the regular addon part,
  both kinds of translations are now merged in a single
  addon/i18n/addon.pot file. Terms that are used by
  the web part are now marked with a PO annotation:
     #. openerp-web
  so the web client can recognize them and only load
  the relevant translations in the browser memory.
  This is important because a complete PO file can
  be rather large, e.g. account/i18n/de.po = 400KB.

- The web translation export scripts were updated to
  behave properly for addons that have a non-web
  part, and will merge the web translation in the
  original POT file, annotating the web translations
  as needed. These scripts are Unix-only and meant
  to be used by OpenERP packagers when needed.

- The GetText spec says that PO auto-comments indicating
  the source location have this form:
   #: /path/to/file:lineno
  However OpenERP's POT export system defaults to a modified
  version of this format with an extra 'type' field:
   #: type:/path/to/file:lineno
  The babel extractors we use have the GetText format 
  hardcoded so a small patch is needed on the server
  to make it more lenient and accept the standard
  source annotation, defaulting to 'code' type.
  This does not matter for openerp-web, but makes sure
  the server will not fail to load the new PO files 
  that contain openerp-web translations with standard
  annotations.
  The patch for making the server more lenient was
  checked in trunk at revision 4002 
  rev-id odo@openerp.com-20120202143210-05p1w24t6u77cyv8

- The existing translation sync and export wizards for
  regular addons have not been updated to consider
  web addons, so for the time being we will have
  to export regular addons terms first, and run the
  web export script (gen_translations.sh) on the
  addons directory afterwards. This could be improved
  later.

As soon as this change is merged we will have to
perform a full update of addons translation
templates in order to include the web terms as well.

bzr revid: odo@openerp.com-20120202145603-ffo0il0qnfp3r6gt
This commit is contained in:
Olivier Dony 2012-02-02 15:56:03 +01:00
parent 7e2bb94661
commit 7ebc5bdba3
149 changed files with 1880 additions and 1329 deletions

View File

@ -244,7 +244,7 @@ class WebClient(openerpweb.Controller):
transs[addon_name] = transl
addons_path = openerpweb.addons_manifest[addon_name]['addons_path']
for l in langs:
f_name = os.path.join(addons_path, addon_name, "po", l + ".po")
f_name = os.path.join(addons_path, addon_name, "i18n", l + ".po")
if not os.path.exists(f_name):
continue
try:
@ -253,7 +253,7 @@ class WebClient(openerpweb.Controller):
except Exception:
continue
for x in po:
if x.id and x.string:
if x.id and x.string and "openerp-web" in x.auto_comments:
transl["messages"].append({'id': x.id, 'string': x.string})
return {"modules": transs,
"lang_parameters": lang_obj}

1365
addons/web/i18n/web.pot Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,14 +1,14 @@
# Translations template for PROJECT.
# Copyright (C) 2011 ORGANIZATION
# Copyright (C) 2012 ORGANIZATION
# This file is distributed under the same license as the PROJECT project.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2011.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2012.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2011-12-20 18:48+0100\n"
"POT-Creation-Date: 2012-02-01 16:37+0100\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"
@ -17,19 +17,24 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 0.9.6\n"
#. openerp-web
#: addons/web_calendar/static/src/js/calendar.js:11
msgid "Calendar"
msgstr ""
#: addons/web_calendar/static/src/js/calendar.js:446
#. openerp-web
#: addons/web_calendar/static/src/js/calendar.js:466
msgid "Responsible"
msgstr ""
#: addons/web_calendar/static/src/js/calendar.js:475
#. openerp-web
#: addons/web_calendar/static/src/js/calendar.js:504
msgid "Navigator"
msgstr ""
#: addons/web_calendar/static/src/xml/web_calendar.xml:0
#. openerp-web
#: addons/web_calendar/static/src/xml/web_calendar.xml:5
#: addons/web_calendar/static/src/xml/web_calendar.xml:6
msgid "&nbsp;"
msgstr ""

View File

@ -1,14 +1,14 @@
# Translations template for PROJECT.
# Copyright (C) 2011 ORGANIZATION
# Copyright (C) 2012 ORGANIZATION
# This file is distributed under the same license as the PROJECT project.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2011.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2012.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2011-12-20 18:48+0100\n"
"POT-Creation-Date: 2012-02-01 16:37+0100\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"

View File

@ -0,0 +1,86 @@
# Translations template for PROJECT.
# Copyright (C) 2012 ORGANIZATION
# This file is distributed under the same license as the PROJECT project.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2012.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2012-02-01 16:37+0100\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"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 0.9.6\n"
#. openerp-web
#: addons/web_dashboard/static/src/js/dashboard.js:63
msgid "Edit Layout"
msgstr ""
#. openerp-web
#: addons/web_dashboard/static/src/js/dashboard.js:109
msgid "Are you sure you want to remove this item ?"
msgstr ""
#. openerp-web
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:6
msgid "Reset"
msgstr ""
#. openerp-web
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:10
msgid "Change Layout"
msgstr ""
#. openerp-web
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:27
msgid "&nbsp;"
msgstr ""
#. openerp-web
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:28
msgid "Create"
msgstr ""
#. openerp-web
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:39
msgid "Choose dashboard layout"
msgstr ""
#. openerp-web
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:62
msgid "progress:"
msgstr ""
#. openerp-web
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:67
msgid ""
"Click on the functionalites listed below to launch them and configure "
"your system"
msgstr ""
#. openerp-web
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:110
msgid "Welcome to OpenERP"
msgstr ""
#. openerp-web
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:118
msgid "Remember to bookmark"
msgstr ""
#. openerp-web
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:119
msgid "This url"
msgstr ""
#. openerp-web
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:121
msgid "Your login:"
msgstr ""

View File

@ -1,77 +0,0 @@
# Translations template for PROJECT.
# Copyright (C) 2011 ORGANIZATION
# This file is distributed under the same license as the PROJECT project.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2011.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2011-12-20 18:48+0100\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"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 0.9.6\n"
#: addons/web_dashboard/static/src/js/dashboard.js:63
msgid "Edit Layout"
msgstr ""
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:0
msgid "Reset"
msgstr ""
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:0
msgid "Change layout"
msgstr ""
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:0
msgid "&nbsp;"
msgstr ""
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:0
msgid "Create"
msgstr ""
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:0
msgid "Choose dashboard layout"
msgstr ""
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:0
msgid "progress:"
msgstr ""
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:0
msgid "%"
msgstr ""
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:0
msgid ""
"Click on the functionalites listed below to launch them and configure "
"your system"
msgstr ""
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:0
msgid "Welcome to OpenERP"
msgstr ""
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:0
msgid "Remember to bookmark this page."
msgstr ""
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:0
msgid "Remember your login:"
msgstr ""
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:0
msgid "Choose the first OpenERP Application you want to install.."
msgstr ""
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:0
msgid "Please choose the first application to install."
msgstr ""

View File

@ -0,0 +1,49 @@
# Translations template for PROJECT.
# Copyright (C) 2012 ORGANIZATION
# This file is distributed under the same license as the PROJECT project.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2012.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2012-02-01 16:37+0100\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"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 0.9.6\n"
#. openerp-web
#: addons/web_diagram/static/src/js/diagram.js:11
msgid "Diagram"
msgstr ""
#. openerp-web
#: addons/web_diagram/static/src/js/diagram.js:208
msgid "Activity"
msgstr ""
#. openerp-web
#: addons/web_diagram/static/src/js/diagram.js:208
msgid "Transition"
msgstr ""
#. openerp-web
#: addons/web_diagram/static/src/js/diagram.js:214
msgid "Create:"
msgstr ""
#. openerp-web
#: addons/web_diagram/static/src/js/diagram.js:231
msgid "Open: "
msgstr ""
#. openerp-web
#: addons/web_diagram/static/src/xml/base_diagram.xml:5
msgid "New Node"
msgstr ""

View File

@ -1,59 +0,0 @@
# Translations template for PROJECT.
# Copyright (C) 2011 ORGANIZATION
# This file is distributed under the same license as the PROJECT project.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2011.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2011-12-20 18:48+0100\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"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 0.9.6\n"
#: addons/web_diagram/static/src/js/diagram.js:11
msgid "Diagram"
msgstr ""
#: addons/web_diagram/static/src/js/diagram.js:210
msgid "Cancel"
msgstr ""
#: addons/web_diagram/static/src/js/diagram.js:211
msgid "Save"
msgstr ""
#: addons/web_diagram/static/src/xml/base_diagram.xml:0
msgid "New Node"
msgstr ""
#: addons/web_diagram/static/src/xml/base_diagram.xml:0
msgid "First"
msgstr ""
#: addons/web_diagram/static/src/xml/base_diagram.xml:0
msgid "<<"
msgstr ""
#: addons/web_diagram/static/src/xml/base_diagram.xml:0
msgid "0"
msgstr ""
#: addons/web_diagram/static/src/xml/base_diagram.xml:0
msgid "/"
msgstr ""
#: addons/web_diagram/static/src/xml/base_diagram.xml:0
msgid ">>"
msgstr ""
#: addons/web_diagram/static/src/xml/base_diagram.xml:0
msgid "Last"
msgstr ""

Some files were not shown because too many files have changed in this diff Show More