Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(553)

Unified Diff: remoting/webapp/build-webapp.py

Issue 20985002: Localized Chromoting Host on Mac and Linux. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/unittests-Info.plist ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/webapp/build-webapp.py
diff --git a/remoting/webapp/build-webapp.py b/remoting/webapp/build-webapp.py
index d221d3d6385f6e189d7382d3eb0391a2a171e053..384aaf1a9fd0e95755f410308f3967c8724d43c1 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
« no previous file with comments | « remoting/unittests-Info.plist ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698