OLD | NEW |
---|---|
1 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 | 5 |
6 import os | 6 import os |
7 import sys | 7 import sys |
8 import types | 8 import types |
9 | 9 |
10 from grit.format import interface | 10 from grit.format import interface |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
87 | 87 |
88 Args: | 88 Args: |
89 item: The grit node parsed currently. | 89 item: The grit node parsed currently. |
90 ''' | 90 ''' |
91 nodes = [] | 91 nodes = [] |
92 if (isinstance(item, misc.IfNode) and not item.IsConditionSatisfied()): | 92 if (isinstance(item, misc.IfNode) and not item.IsConditionSatisfied()): |
93 return | 93 return |
94 if (isinstance(item, structure.StructureNode) and | 94 if (isinstance(item, structure.StructureNode) and |
95 item.attrs['type'] == 'policy_template_metafile'): | 95 item.attrs['type'] == 'policy_template_metafile'): |
96 assert self._policy_data == None | 96 assert self._policy_data == None |
97 json_text = item.gatherer.Translate(self._lang) | 97 json_text = item.gatherer.Translate( |
98 self._lang, | |
99 pseudo_if_not_available=False, | |
Jói
2011/05/23 13:13:51
pseudo_if_not_available and fallback_to_english ar
gfeher
2011/05/23 20:55:10
Done!
| |
100 fallback_to_english=True) | |
98 self._policy_data = eval(json_text) | 101 self._policy_data = eval(json_text) |
99 for child in item.children: | 102 for child in item.children: |
100 self._ParseGritNodes(child) | 103 self._ParseGritNodes(child) |
OLD | NEW |