diff options
author | alexeypa@chromium.org <alexeypa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-30 17:16:07 +0000 |
---|---|---|
committer | alexeypa@chromium.org <alexeypa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-30 17:16:07 +0000 |
commit | 4534fb9f24c7e2f20e14da858ad3a0f398847323 (patch) | |
tree | 5b6e2e9a70d15e331a486e2f2a1e8abc950efbda /remoting/webapp/build-webapp.py | |
parent | c4bc9eb947207d668dcb2ce85c2603f4281161e9 (diff) | |
download | chromium_src-4534fb9f24c7e2f20e14da858ad3a0f398847323.zip chromium_src-4534fb9f24c7e2f20e14da858ad3a0f398847323.tar.gz chromium_src-4534fb9f24c7e2f20e14da858ad3a0f398847323.tar.bz2 |
Localized Chromoting Host on Mac and Linux.
Re-landing r213997. TBR because this is a trivial, mechanical fix.
This CL implements generation of localizable strings from remoting_strings.grd file. Depending on the platform the localized resources are placed to:
- Mac: localized .string and .pak resources are added to each application bundle under 'Resources/<locale>.lproj'
- Linux: localized .pak files are placed under 'remoting_locales' directory next to the binary locading them.
- Windows: .rc resources are generated from .jinja2 templates and embedded into a relevant binary.
Chrome l10n and i18n APIs are used to retrieve the current locale and RTL flag (Mac & Linux). The it2me plugin sets the locale to match the locale of the browser.
Collateral changes:
- UiString is not used any more.
- Increased width of disconnect window message on Mac.
- The host plugin version is correctly reported on Mac.
- Dialogs use RTL templates in case of RTL languages. No more updating the templates dynamically (Windows).
- remoting_unittests.ResourcesTest now runs on Mac, LInux and Windows.
- '@' is used for variable substitutions by remoting_localize.py.
- HOST_PLUGIN_MIME_TYPE is defined in one place now.
- Deleted unused commong_resources.grd.
Mac installer and preference panel are not localized yet.
TBR=garykac@chromium.org
BUG=155204
Review URL: https://codereview.chromium.org/20985002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@214379 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/webapp/build-webapp.py')
-rwxr-xr-x | remoting/webapp/build-webapp.py | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/remoting/webapp/build-webapp.py b/remoting/webapp/build-webapp.py index d221d3d..384aaf1 100755 --- a/remoting/webapp/build-webapp.py +++ b/remoting/webapp/build-webapp.py @@ -124,21 +124,23 @@ def buildWebApp(buildtype, version, mimetype, destination, zip_path, plugin, # Copy all the locales, preserving directory structure destination_locales = os.path.join(destination, "_locales") os.mkdir(destination_locales , 0775) - locale_dir = "/_locales/" + remoting_locales = os.path.join(destination, "remoting_locales") + os.mkdir(remoting_locales , 0775) for current_locale in locales: - pos = current_locale.find(locale_dir) - if (pos == -1): - raise Exception("Missing locales directory in " + current_locale) - subtree = current_locale[pos + len(locale_dir):] - pos = subtree.find("/") - if (pos == -1): - raise Exception("Malformed locale: " + current_locale) - locale_id = subtree[:pos] - messages = subtree[pos+1:] - destination_dir = os.path.join(destination_locales, locale_id) - destination_file = os.path.join(destination_dir, messages) - os.mkdir(destination_dir, 0775) - shutil.copy2(current_locale, destination_file) + extension = os.path.splitext(current_locale)[1] + if extension == '.json': + locale_id = os.path.split(os.path.split(current_locale)[0])[1] + destination_dir = os.path.join(destination_locales, locale_id) + destination_file = os.path.join(destination_dir, + os.path.split(current_locale)[1]) + os.mkdir(destination_dir, 0775) + shutil.copy2(current_locale, destination_file) + elif extension == '.pak': + destination_file = os.path.join(remoting_locales, + os.path.split(current_locale)[1]) + shutil.copy2(current_locale, destination_file) + else: + raise Exception("Unknown extension: " + current_locale); # Create fake plugin files to appease the manifest checker. # It requires that if there is a plugin listed in the manifest that |