diff options
author | sergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-02 02:54:01 +0000 |
---|---|---|
committer | sergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-02 02:54:01 +0000 |
commit | b0e6d485c3e12ff4af513d6d7faa97c4917f907b (patch) | |
tree | faf394027cf9f7d946bfd49e9e77f4e612cc9d3a /remoting/tools | |
parent | d9310a80f731a62d31ae138b0cc743a6dd5007e1 (diff) | |
download | chromium_src-b0e6d485c3e12ff4af513d6d7faa97c4917f907b.zip chromium_src-b0e6d485c3e12ff4af513d6d7faa97c4917f907b.tar.gz chromium_src-b0e6d485c3e12ff4af513d6d7faa97c4917f907b.tar.bz2 |
Fix branding in chromoting string resources.
When chromoting resources were converted from messages.json to .grd format
incorrect branding was used. Beside that simplified how resources are
generated:
1. Now <if> is used to handle branded strings instead of generating grd file in build time
2. Removed resource_ids - ids are now specified in grd files.
BUG=158995
Review URL: https://chromiumcodereview.appspot.com/11275101
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@165605 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/tools')
-rwxr-xr-x | remoting/tools/remove_official_branding.py | 52 |
1 files changed, 0 insertions, 52 deletions
diff --git a/remoting/tools/remove_official_branding.py b/remoting/tools/remove_official_branding.py deleted file mode 100755 index 9d9d4cb..0000000 --- a/remoting/tools/remove_official_branding.py +++ /dev/null @@ -1,52 +0,0 @@ -#!/usr/bin/env python -# Copyright (c) 2012 The Chromium Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -"""Replaces "Chrome Remote Desktop" with "Chromoting" in GRD files""" - -import sys -from optparse import OptionParser -import xml.dom.minidom as minidom - -def update_xml_node(element): - for child in element.childNodes: - if child.nodeType == minidom.Node.ELEMENT_NODE: - update_xml_node(child) - elif child.nodeType == minidom.Node.TEXT_NODE: - child.replaceWholeText( - child.data.replace("Chrome Remote Desktop", "Chromoting")) - -def remove_official_branding(input_file, output_file): - xml = minidom.parse(input_file) - - # Remove all translations. - for translations in xml.getElementsByTagName("translations"): - for translation in translations.getElementsByTagName("file"): - translations.removeChild(translation) - - for outputs in xml.getElementsByTagName("outputs"): - for output in outputs.getElementsByTagName("output"): - lang = output.getAttribute("lang") - if lang and lang != "en": - outputs.removeChild(output) - - # Update branding. - update_xml_node(xml) - - out = file(output_file, "w") - out.write(xml.toxml(encoding = "UTF-8")) - out.close() - -def main(): - usage = 'Usage: remove_official_branding <input.grd> <output.grd>' - parser = OptionParser(usage=usage) - options, args = parser.parse_args() - if len(args) != 2: - parser.error('two positional arguments expected') - - return remove_official_branding(args[0], args[1]) - -if __name__ == '__main__': - sys.exit(main()) - |