diff options
Diffstat (limited to 'chrome/installer')
-rwxr-xr-x | chrome/installer/util/prebuild/create_string_rc.py | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/chrome/installer/util/prebuild/create_string_rc.py b/chrome/installer/util/prebuild/create_string_rc.py index cf081e1..187e22d 100755 --- a/chrome/installer/util/prebuild/create_string_rc.py +++ b/chrome/installer/util/prebuild/create_string_rc.py @@ -85,7 +85,8 @@ class TranslationStruct: def __cmp__(self, other): """Allow TranslationStructs to be sorted by id.""" - return cmp(self.resource_id_str, other.resource_id_str) + id_result = cmp(self.resource_id_str, other.resource_id_str) + return cmp(self.language, other.language) if id_result == 0 else id_result def CollectTranslatedStrings(branding): @@ -124,7 +125,7 @@ def CollectTranslatedStrings(branding): # have a .xtb file. translated_strings = [] for string_id, message_text in zip(kStringIds, message_texts): - translated_strings.append(TranslationStruct(string_id + '_EN_US', + translated_strings.append(TranslationStruct(string_id, 'EN_US', message_text)) @@ -144,7 +145,7 @@ def CollectTranslatedStrings(branding): for i, string_id in enumerate(kStringIds): translated_string = translation_nodes.get(translation_ids[i], message_texts[i]) - translated_strings.append(TranslationStruct(string_id + '_' + language, + translated_strings.append(TranslationStruct(string_id, language, translated_string)) @@ -168,7 +169,8 @@ def WriteRCFile(translated_strings, out_filename): translation = (translation_struct.translation.replace('"', '""') .replace('\t', '\\t') .replace('\n', '\\n')) - lines.append(u' %s "%s"\n' % (translation_struct.resource_id_str, + lines.append(u' %s "%s"\n' % (translation_struct.resource_id_str + '_' + + translation_struct.language, translation)) lines.append(kFooterText) outfile = open(out_filename + '.rc', 'wb') @@ -198,7 +200,8 @@ def WriteHeaderFile(translated_strings, out_filename): # Write the resource ids themselves. resource_id = kFirstResourceID for translation_struct in translated_strings: - lines.append('#define %s %s' % (translation_struct.resource_id_str, + lines.append('#define %s %s' % (translation_struct.resource_id_str + '_' + + translation_struct.language, resource_id)) resource_id += 1 |