diff options
Diffstat (limited to 'chromium/tools/grit/grit/node/io.py')
-rw-r--r-- | chromium/tools/grit/grit/node/io.py | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/chromium/tools/grit/grit/node/io.py b/chromium/tools/grit/grit/node/io.py index 1e590c56b98..9962bffe587 100644 --- a/chromium/tools/grit/grit/node/io.py +++ b/chromium/tools/grit/grit/node/io.py @@ -52,12 +52,15 @@ class FileNode(base.Node): except: print "Exception during parsing of %s" % self.GetInputPath() raise - # We special case 'he' and 'iw' because the translation console uses 'iw' - # and we use 'he'. + # Translation console uses non-standard language codes 'iw' and 'no' for + # Hebrew and Norwegian Bokmal instead of 'he' and 'nb' used in Chrome. + # Note that some Chrome's .grd still use 'no' instead of 'nb', but 'nb' is + # always used for generated .pak files. + ALTERNATIVE_LANG_CODE_MAP = { 'he': 'iw', 'nb': 'no' } assert (lang == self.attrs['lang'] or - (lang == 'iw' and self.attrs['lang'] == 'he')), ('The XTB file you ' - 'reference must contain messages in the language specified\n' - 'by the \'lang\' attribute.') + lang == ALTERNATIVE_LANG_CODE_MAP[self.attrs['lang']]), ( + 'The XTB file you reference must contain messages in the language ' + 'specified\nby the \'lang\' attribute.') def GetInputPath(self): return os.path.expandvars(self.attrs['path']) |