Commit 418589ba authored by Joel Hockey's avatar Joel Hockey Committed by Commit Bot

Fix FilesApp UI Test generation script i18n substitutions.

Support replacing $i18nRaw{} in addition to $i18n{}.
Fix 'textDirection' as used in text_defaults.css.

Change-Id: I1f9b5c97ba28e69f35c42f55ae08b12df9eb9842
Reviewed-on: https://chromium-review.googlesource.com/c/1454059
Commit-Queue: Joel Hockey <joelhockey@chromium.org>
Commit-Queue: Sam McNally <sammc@chromium.org>
Auto-Submit: Joel Hockey <joelhockey@chromium.org>
Reviewed-by: default avatarSam McNally <sammc@chromium.org>
Cr-Commit-Position: refs/heads/master@{#629056}
parent 340ce5bf
......@@ -99,7 +99,7 @@ strings = {
'fontFamily': 'Roboto, sans-serif',
'fontSize': '75%',
'language': 'en',
'textdirection': 'ltr',
'textDirection': 'ltr',
}
grdp_files = [
'../../../chrome/app/chromeos_strings.grdp',
......@@ -118,9 +118,10 @@ for m in re.finditer(r'SET_STRING\(\"(.*?)\",\s+(\w+)\);', private_api_strings):
strings[m.group(1)] = resource_bundle.get(m.group(2), m.group(2))
# Substitute $i18n{} and $i18nRaw{} in template with strings from grdp files.
def i18n(template):
repl = lambda x: strings.get(x.group(1), x.group())
return re.sub(r'\$i18n\{(.*?)\}', repl, template)
return re.sub(r'\$i18n(?:Raw)?\{(.*?)\}', repl, template)
# Substitute $i18n{}.
# Update relative paths.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment