current.T.is_writable=False no languages write, thanks Fran
This commit is contained in:
@@ -1 +1 @@
|
|||||||
Version 2.1.1 (2012-10-16 10:34:32) dev
|
Version 2.1.1 (2012-10-16 10:54:30) dev
|
||||||
|
|||||||
+3
-2
@@ -417,6 +417,7 @@ class translator(object):
|
|||||||
self.folder = request.folder
|
self.folder = request.folder
|
||||||
self.langpath = pjoin(self.folder, 'languages')
|
self.langpath = pjoin(self.folder, 'languages')
|
||||||
self.http_accept_language = request.env.http_accept_language
|
self.http_accept_language = request.env.http_accept_language
|
||||||
|
self.is_writable = is_writable
|
||||||
# filled in self.force():
|
# filled in self.force():
|
||||||
#------------------------
|
#------------------------
|
||||||
# self.cache
|
# self.cache
|
||||||
@@ -538,7 +539,7 @@ class translator(object):
|
|||||||
form = self.construct_plural_form(word, id)
|
form = self.construct_plural_form(word, id)
|
||||||
forms[id-1] = form
|
forms[id-1] = form
|
||||||
self.plural_dict[word] = forms
|
self.plural_dict[word] = forms
|
||||||
if self.plural_file and is_writable:
|
if self.plural_file and self.is_writable:
|
||||||
write_plural_dict(self.plural_file,
|
write_plural_dict(self.plural_file,
|
||||||
self.plural_dict)
|
self.plural_dict)
|
||||||
return form
|
return form
|
||||||
@@ -724,7 +725,7 @@ class translator(object):
|
|||||||
# guess translation same as original
|
# guess translation same as original
|
||||||
self.t[key] = mt = self.default_t.get(key, message)
|
self.t[key] = mt = self.default_t.get(key, message)
|
||||||
# update language file for latter translation
|
# update language file for latter translation
|
||||||
if self.language_file != self.default_language_file and is_writable:
|
if self.language_file != self.default_language_file and self.is_writable:
|
||||||
write_dict(self.language_file, self.t)
|
write_dict(self.language_file, self.t)
|
||||||
return regex_backslash.sub(
|
return regex_backslash.sub(
|
||||||
lambda m: m.group(1).translate(ttab_in), mt)
|
lambda m: m.group(1).translate(ttab_in), mt)
|
||||||
|
|||||||
Reference in New Issue
Block a user