Index: grit/format/chrome_messages_json.py |
diff --git a/grit/format/chrome_messages_json.py b/grit/format/chrome_messages_json.py |
index be934ab1175924657a79796dbf0def4c2464ec5f..4c3a473a573afc7daa3452cd224ee5db23beb344 100644 |
--- a/grit/format/chrome_messages_json.py |
+++ b/grit/format/chrome_messages_json.py |
@@ -28,8 +28,18 @@ def Format(root, lang='en', output_dir='.'): |
if id.startswith('IDR_') or id.startswith('IDS_'): |
id = id[4:] |
- loc_message = encoder.encode(child.ws_at_start + child.Translate(lang) + |
- child.ws_at_end) |
+ cliques = child.GetCliques() |
+ assert cliques |
+ translation = cliques[0].MessageForLanguage( |
+ lang, pseudo_if_no_match=child.PseudoIsAllowed(), |
+ fallback_to_english=False, none_if_no_match=True) |
+ |
+ # Skip the string if it's not translated. |
+ if translation == None: |
Jamie
2015/10/27 19:25:13
Prefer "translation is not None" (https://google-s
Sergey Ulanov
2016/02/06 01:03:17
Done.
|
+ continue; |
+ |
+ loc_message = encoder.encode( |
+ child.ws_at_start + translation.GetRealContent() + child.ws_at_end) |
if not first: |
yield ',\n' |