Chromium Code Reviews| Index: remoting/tools/build/remoting_localize.py |
| diff --git a/remoting/tools/build/remoting_localize.py b/remoting/tools/build/remoting_localize.py |
| index 8dc05386790715aaf71f7954d7aab0a74eb09494..b5244bb1e095affed13b2aa4ab95b780923931e2 100755 |
| --- a/remoting/tools/build/remoting_localize.py |
| +++ b/remoting/tools/build/remoting_localize.py |
| @@ -542,7 +542,10 @@ def IsRtlLanguage(language): |
| def NormalizeLanguageCode(language): |
| - return language.replace('_', '-', 1) |
| + lang = language.replace('_', '-', 1) |
| + if lang == 'en-US': |
| + lang = 'en' |
| + return lang |
| def GetDataPackageSuffix(language): |
| @@ -639,6 +642,12 @@ class MessageMap: |
| return lambda message: self.GetText(message) |
| +# Use '@' as a delimiter for string templates instead of '$' to avoid unintended |
| +# expansion when passing the string frmo GYP. |
|
garykac
2013/07/26 16:20:15
from
alexeypa (please no reviews)
2013/07/26 18:55:01
Done.
|
| +class GypTemplate(Template): |
| + delimiter = '@' |
| + |
| + |
| def Localize(source, locales, options): |
| # Set the list of languages to use. |
| languages = map(NormalizeLanguageCode, locales) |
| @@ -701,12 +710,13 @@ def Localize(source, locales, options): |
| # Generate a separate file per each locale if requested. |
| outputs = [] |
| if options.locale_output: |
| - target = Template(options.locale_output) |
| + target = GypTemplate(options.locale_output) |
| for lang in languages: |
| context['languages'] = [ lang ] |
| context['language'] = lang |
| context['pak_suffix'] = GetDataPackageSuffix(lang) |
| context['json_suffix'] = GetJsonSuffix(lang) |
| + message_map.SelectLanguage(lang) |
| template_file_name = target.safe_substitute(context) |
| outputs.append(template_file_name) |