summaryrefslogtreecommitdiff
path: root/bin/tools/translate.py
diff options
context:
space:
mode:
authorOlivier Dony <odo@openerp.com>2011-01-06 18:38:28 +0100
committerOlivier Dony <odo@openerp.com>2011-01-06 18:38:28 +0100
commit7d3375f49f6d4ef47b148dc3f229f3012a358643 (patch)
treefadd5ac0486560e6f7ce70c23d93fc5a76a3e585 /bin/tools/translate.py
parentf68dbc723c2a74aed5bb2c4add9ccb76bb82d1bf (diff)
parentbf5765b3ef0f22dcbca413e86fc39dfef9f1d87f (diff)
[MERGE] bugfixes: default language for partners, password change, validation of custom selection fields, ...
See the bug links lp bug: https://launchpad.net/bugs/670264 fixed lp bug: https://launchpad.net/bugs/692891 fixed lp bug: https://launchpad.net/bugs/695678 fixed lp bug: https://launchpad.net/bugs/631547 fixed lp bug: https://launchpad.net/bugs/632927 fixed bzr revid: odo@openerp.com-20110106173828-kdv1gtdvbws1ceb5
Diffstat (limited to 'bin/tools/translate.py')
-rw-r--r--bin/tools/translate.py45
1 files changed, 5 insertions, 40 deletions
diff --git a/bin/tools/translate.py b/bin/tools/translate.py
index c1c09140d0a..3b0b0f1173c 100644
--- a/bin/tools/translate.py
+++ b/bin/tools/translate.py
@@ -347,7 +347,7 @@ class TinyPoFile(object):
if name is None:
if not fuzzy:
- self.warn('Missing "#:" formated comment at line %d for the following source:\n\t%s',
+ self.warn('Missing "#:" formated comment at line %d for the following source:\n\t%s',
self.cur_line(), source[:30])
return self.next()
return type, name, res_id, source, trad
@@ -541,9 +541,9 @@ def trans_generate(lang, modules, dbname=None):
query = 'SELECT name, model, res_id, module' \
' FROM ir_model_data'
-
- query_models = """SELECT m.id, m.model, imd.module
- FROM ir_model AS m, ir_model_data AS imd
+
+ query_models = """SELECT m.id, m.model, imd.module
+ FROM ir_model AS m, ir_model_data AS imd
WHERE m.id = imd.res_id AND imd.model = 'ir.model' """
if 'all_installed' in modules:
@@ -869,42 +869,7 @@ def trans_load_data(db_name, fileobj, fileformat, lang, lang_name=None, verbose=
if not ids:
# lets create the language with locale information
- fail = True
- for ln in get_locales(lang):
- try:
- locale.setlocale(locale.LC_ALL, str(ln))
- fail = False
- break
- except locale.Error:
- continue
- if fail:
- lc = locale.getdefaultlocale()[0]
- msg = 'Unable to get information for locale %s. Information from the default locale (%s) have been used.'
- logger.warning(msg, lang, lc)
-
- if not lang_name:
- lang_name = tools.get_languages().get(lang, lang)
-
- def fix_xa0(s):
- if s == '\xa0':
- return '\xc2\xa0'
- return s
-
- lang_info = {
- 'code': lang,
- 'iso_code': iso_lang,
- 'name': lang_name,
- 'translatable': 1,
- 'date_format' : str(locale.nl_langinfo(locale.D_FMT).replace('%y', '%Y')),
- 'time_format' : str(locale.nl_langinfo(locale.T_FMT)),
- 'decimal_point' : fix_xa0(str(locale.localeconv()['decimal_point'])),
- 'thousands_sep' : fix_xa0(str(locale.localeconv()['thousands_sep'])),
- }
-
- try:
- lang_obj.create(cr, uid, lang_info)
- finally:
- resetlocale()
+ lang_obj.load_lang(cr, 1, lang=lang, lang_name=lang_name)
# now, the serious things: we read the language file