diff options
author | gfeher@chromium.org <gfeher@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-24 20:34:17 +0000 |
---|---|---|
committer | gfeher@chromium.org <gfeher@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-24 20:34:17 +0000 |
commit | e33bd5b260b1f40156a92d9eacaa62cabcde0eac (patch) | |
tree | 631ef6d09445caa65c3154e60a3dc2bed2b391f1 /tools | |
parent | 3f882613e62b9fbbfcdf8b8f4003bd66cd23d7ff (diff) | |
download | chromium_src-e33bd5b260b1f40156a92d9eacaa62cabcde0eac.zip chromium_src-e33bd5b260b1f40156a92d9eacaa62cabcde0eac.tar.gz chromium_src-e33bd5b260b1f40156a92d9eacaa62cabcde0eac.tar.bz2 |
Start generating translated policy templates
-Add output nodes of translations into policy_templates.grd.
-Copy translated string tables into the Mac bundle.
-Work around the problem that the zip tool would get too long command-line arguments if all the translated templates were enumerated as arguments.
-Fix importing of UTF-8 strings into the template generator
BUG=61779
TEST=Check that there are translated adml, adm and html files in policy_templates.zip.
Review URL: http://codereview.chromium.org/6969064
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@86476 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools')
-rw-r--r-- | tools/grit/grit/format/policy_templates/policy_template_generator.py | 1 | ||||
-rw-r--r-- | tools/grit/grit/format/policy_templates/template_formatter.py | 5 |
2 files changed, 5 insertions, 1 deletions
diff --git a/tools/grit/grit/format/policy_templates/policy_template_generator.py b/tools/grit/grit/format/policy_templates/policy_template_generator.py index 1d54b972..e2f61e6 100644 --- a/tools/grit/grit/format/policy_templates/policy_template_generator.py +++ b/tools/grit/grit/format/policy_templates/policy_template_generator.py @@ -16,6 +16,7 @@ class PolicyTemplateGenerator: ''' def _ImportMessage(self, msg_txt): + msg_txt = msg_txt.decode('utf-8') # Replace the placeholder of app name. msg_txt = msg_txt.replace('$1', self._config['app_name']) msg_txt = msg_txt.replace('$2', self._config['os_name']) diff --git a/tools/grit/grit/format/policy_templates/template_formatter.py b/tools/grit/grit/format/policy_templates/template_formatter.py index 0e304af..fdd5dd9 100644 --- a/tools/grit/grit/format/policy_templates/template_formatter.py +++ b/tools/grit/grit/format/policy_templates/template_formatter.py @@ -94,7 +94,10 @@ class TemplateFormatter(interface.ItemFormatter): if (isinstance(item, structure.StructureNode) and item.attrs['type'] == 'policy_template_metafile'): assert self._policy_data == None - json_text = item.gatherer.Translate(self._lang) + json_text = item.gatherer.Translate( + self._lang, + pseudo_if_not_available=item.PseudoIsAllowed(), + fallback_to_english=item.ShouldFallbackToEnglish()) self._policy_data = eval(json_text) for child in item.children: self._ParseGritNodes(child) |