Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(67)

Unified Diff: remoting/tools/build/remoting_localize.py

Issue 19803010: Localized Chromoting Host on Mac and Linux. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Adding a missing dependency Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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)

Powered by Google App Engine
This is Rietveld 408576698