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

Issue 20985002: Localized Chromoting Host on Mac and Linux. (Closed)

Created:
7 years, 4 months ago by alexeypa (please no reviews)
Modified:
7 years, 4 months ago
Reviewers:
garykac
CC:
chromium-reviews, jamiewalch+watch_chromium.org, dcaiafa+watch_chromium.org, hclam+watch_chromium.org, wez+watch_chromium.org, amit, sanjeevr, garykac+watch_chromium.org, lambroslambrou+watch_chromium.org, rmsousa+watch_chromium.org, weitaosu+watch_chromium.org, alexeypa+watch_chromium.org, sergeyu+watch_chromium.org
Visibility:
Public.

Description

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 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=214379

Patch Set 1 #

Patch Set 2 : - #

Patch Set 3 : rebased #

Unified diffs Side-by-side diffs Delta from patch set Stats (+607 lines, -674 lines) Patch
M remoting/base/resources.h View 1 chunk +6 lines, -2 lines 0 comments Download
D remoting/base/resources.cc View 1 chunk +0 lines, -35 lines 0 comments Download
A remoting/base/resources_linux.cc View 1 chunk +44 lines, -0 lines 0 comments Download
A remoting/base/resources_mac.mm View 1 chunk +43 lines, -0 lines 0 comments Download
M remoting/base/resources_unittest.cc View 1 chunk +19 lines, -25 lines 0 comments Download
A remoting/base/resources_win.cc View 1 chunk +17 lines, -0 lines 0 comments Download
M remoting/branding_Chrome View 2 chunks +0 lines, -5 lines 0 comments Download
M remoting/branding_Chromium View 2 chunks +0 lines, -5 lines 0 comments Download
M remoting/host/basic_desktop_environment.h View 5 chunks +1 line, -10 lines 0 comments Download
M remoting/host/basic_desktop_environment.cc View 1 chunk +2 lines, -4 lines 0 comments Download
M remoting/host/continue_window.h View 3 chunks +1 line, -7 lines 0 comments Download
M remoting/host/continue_window.cc View 1 chunk +1 line, -2 lines 0 comments Download
M remoting/host/continue_window_gtk.cc View 5 chunks +11 lines, -11 lines 0 comments Download
M remoting/host/continue_window_mac.mm View 7 chunks +14 lines, -22 lines 0 comments Download
M remoting/host/continue_window_win.cc View 3 chunks +5 lines, -7 lines 0 comments Download
M remoting/host/desktop_process_main.cc View 3 chunks +1 line, -7 lines 0 comments Download
M remoting/host/disconnect_window_gtk.cc View 8 chunks +13 lines, -16 lines 0 comments Download
M remoting/host/disconnect_window_mac.h View 1 chunk +2 lines, -8 lines 0 comments Download
M remoting/host/disconnect_window_mac.mm View 5 chunks +17 lines, -26 lines 0 comments Download
M remoting/host/disconnect_window_win.cc View 6 chunks +7 lines, -42 lines 0 comments Download
M remoting/host/host_main.cc View 2 chunks +6 lines, -0 lines 0 comments Download
M remoting/host/host_window.h View 1 chunk +2 lines, -5 lines 0 comments Download
M remoting/host/installer/mac/uninstaller/remoting_uninstaller-Info.plist View 2 chunks +0 lines, -4 lines 0 comments Download
A remoting/host/installer/mac/uninstaller/remoting_uninstaller-InfoPlist.strings.jinja2 View 1 chunk +2 lines, -0 lines 0 comments Download
M remoting/host/it2me_desktop_environment.h View 2 chunks +2 lines, -4 lines 0 comments Download
M remoting/host/it2me_desktop_environment.cc View 4 chunks +6 lines, -10 lines 0 comments Download
M remoting/host/mac/me2me_preference_pane-Info.plist View 2 chunks +0 lines, -6 lines 0 comments Download
A remoting/host/mac/me2me_preference_pane-InfoPlist.strings.jinja2 View 1 chunk +3 lines, -0 lines 0 comments Download
M remoting/host/me2me_desktop_environment.h View 2 chunks +1 line, -3 lines 0 comments Download
M remoting/host/me2me_desktop_environment.cc View 4 chunks +3 lines, -7 lines 0 comments Download
D remoting/host/plugin/constants.h View 1 chunk +0 lines, -25 lines 0 comments Download
M remoting/host/plugin/host_plugin.cc View 8 chunks +47 lines, -10 lines 0 comments Download
M remoting/host/plugin/host_plugin-Info.plist View 1 chunk +2 lines, -6 lines 0 comments Download
A remoting/host/plugin/host_plugin-InfoPlist.strings.jinja2 View 1 chunk +3 lines, -0 lines 0 comments Download
M remoting/host/plugin/host_script_object.h View 2 chunks +0 lines, -4 lines 0 comments Download
M remoting/host/plugin/host_script_object.cc View 5 chunks +13 lines, -26 lines 0 comments Download
M remoting/host/remoting_me2me_host.cc View 3 chunks +1 line, -6 lines 0 comments Download
M remoting/host/remoting_me2me_host-Info.plist View 1 chunk +0 lines, -2 lines 0 comments Download
A remoting/host/remoting_me2me_host-InfoPlist.strings.jinja2 View 1 chunk +1 line, -0 lines 0 comments Download
D remoting/host/ui_strings.h View 1 chunk +0 lines, -50 lines 0 comments Download
D remoting/host/ui_strings.cc View 1 chunk +0 lines, -34 lines 0 comments Download
M remoting/host/win/core.rc.jinja2 View 1 3 chunks +4 lines, -4 lines 0 comments Download
M remoting/host/win/session_desktop_environment.h View 2 chunks +0 lines, -3 lines 0 comments Download
M remoting/host/win/session_desktop_environment.cc View 2 chunks +1 line, -4 lines 0 comments Download
M remoting/host/win/version.rc.jinja2 View 2 chunks +2 lines, -1 line 0 comments Download
M remoting/remoting.gyp View 1 2 28 chunks +190 lines, -59 lines 0 comments Download
D remoting/resources/common_resources.grd View 1 chunk +0 lines, -18 lines 0 comments Download
M remoting/resources/remoting_strings.grd View 4 chunks +68 lines, -45 lines 0 comments Download
M remoting/resources/resource_ids View 1 chunk +0 lines, -3 lines 0 comments Download
A + remoting/tools/build/remoting_copy_locales.py View 7 chunks +15 lines, -73 lines 0 comments Download
M remoting/tools/build/remoting_localize.py View 3 chunks +12 lines, -2 lines 0 comments Download
M remoting/tools/verify_resources.py View 2 chunks +2 lines, -2 lines 0 comments Download
A + remoting/unittests-Info.plist View 2 chunks +1 line, -10 lines 0 comments Download
M remoting/webapp/build-webapp.py View 1 chunk +16 lines, -14 lines 0 comments Download

Messages

Total messages: 13 (0 generated)
alexeypa (please no reviews)
This is a re-land of https://chromiumcodereview.appspot.com/19803010/. TBR, because the fix is trivial and mechanical.
7 years, 4 months ago (2013-07-28 22:33:01 UTC) #1
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/alexeypa@chromium.org/20985002/2001
7 years, 4 months ago (2013-07-28 22:34:19 UTC) #2
commit-bot: I haz the power
Retried try job too often on win_rel for step(s) telemetry_unittests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=win_rel&number=180709
7 years, 4 months ago (2013-07-29 00:27:38 UTC) #3
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/alexeypa@chromium.org/20985002/2001
7 years, 4 months ago (2013-07-29 00:40:30 UTC) #4
commit-bot: I haz the power
Retried try job too often on win7_aura for step(s) interactive_ui_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=win7_aura&number=64262
7 years, 4 months ago (2013-07-29 02:17:05 UTC) #5
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/alexeypa@chromium.org/20985002/2001
7 years, 4 months ago (2013-07-29 03:05:41 UTC) #6
commit-bot: I haz the power
Retried try job too often on win7_aura for step(s) interactive_ui_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=win7_aura&number=64309
7 years, 4 months ago (2013-07-29 04:43:54 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/alexeypa@chromium.org/20985002/2001
7 years, 4 months ago (2013-07-29 14:03:19 UTC) #8
commit-bot: I haz the power
Retried try job too often on win7_aura for step(s) interactive_ui_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=win7_aura&number=64633
7 years, 4 months ago (2013-07-29 19:19:30 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/alexeypa@chromium.org/20985002/2001
7 years, 4 months ago (2013-07-30 08:34:17 UTC) #10
alexeypa (please no reviews)
Committed patchset #3 manually as r214379 (presubmit successful).
7 years, 4 months ago (2013-07-30 17:16:14 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/alexeypa@chromium.org/20985002/2001
7 years, 4 months ago (2013-07-30 17:34:36 UTC) #12
commit-bot: I haz the power
7 years, 4 months ago (2013-07-30 17:35:31 UTC) #13
Message was sent while issue was closed.
Failed to apply patch for remoting/tools/build/remoting_copy_locales.py:
File exist but was about to be overwriten
Patch:   NR 
chrome/tools/build/repack_locales.py->remoting/tools/build/remoting_copy_locales.py
Index: remoting/tools/build/remoting_copy_locales.py
diff --git a/chrome/tools/build/repack_locales.py
b/remoting/tools/build/remoting_copy_locales.py
similarity index 57%
copy from chrome/tools/build/repack_locales.py
copy to remoting/tools/build/remoting_copy_locales.py
index
a43e17177a8f16037f7a4a8b7e0d41daa9da013a..4d1d41a9f42c6a2967af9b229b057058c789b7d2
100755
--- a/chrome/tools/build/repack_locales.py
+++ b/remoting/tools/build/remoting_copy_locales.py
@@ -1,5 +1,5 @@
 #!/usr/bin/env python
-# Copyright (c) 2012 The Chromium Authors. All rights reserved.
+# Copyright 2013 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.
 
@@ -18,12 +18,8 @@ sys.path.append(os.path.join(os.path.dirname(__file__), '..',
'..', '..',
                              'tools', 'grit'))
 from grit.format import data_pack
 
-# The gyp "branding" variable.
-BRANDING = None
-
 # Some build paths defined by gyp.
 GRIT_DIR = None
-SHARE_INT_DIR = None
 INT_DIR = None
 
 # The target platform. If it is not defined, sys.platform will be used.
@@ -39,68 +35,22 @@ class Usage(Exception):
 
 def calc_output(locale):
   """Determine the file that will be generated for the given locale."""
-  #e.g. '<(INTERMEDIATE_DIR)/repack/da.pak',
-  # For Fake Bidi, generate it at a fixed path so that tests can safely
-  # reference it.
-  if locale == 'fake-bidi':
-    return '%s/%s.pak' % (INT_DIR, locale)
+  #e.g. '<(INTERMEDIATE_DIR)/remoting_locales/da.pak',
   if OS == 'mac' or OS == 'ios':
     # For Cocoa to find the locale at runtime, it needs to use '_' instead
-    # of '-' (http://crbug.com/20441).  Also, 'en-US' should be represented
-    # simply as 'en' (http://crbug.com/19165, http://crbug.com/25578).
-    if locale == 'en-US':
-      locale = 'en'
-    return '%s/repack/%s.lproj/locale.pak' % (INT_DIR, locale.replace('-',
'_'))
+    # of '-' (http://crbug.com/20441).
+    return os.path.join(INT_DIR, 'remoting', 'resources',
+                        '%s.lproj' % locale.replace('-', '_'), 'locale.pak')
   else:
-    return os.path.join(INT_DIR, 'repack', locale + '.pak')
+    return os.path.join(INT_DIR, 'remoting_locales', locale + '.pak')
 
 
 def calc_inputs(locale):
   """Determine the files that need processing for the given locale."""
   inputs = []
 
-  #e.g. '<(grit_out_dir)/generated_resources_da.pak'
-  inputs.append(os.path.join(GRIT_DIR, 'generated_resources_%s.pak' % locale))
-
-  #e.g. '<(grit_out_dir)/locale_settings_da.pak'
-  inputs.append(os.path.join(GRIT_DIR, 'locale_settings_%s.pak' % locale))
-
-  #e.g. '<(grit_out_dir)/platform_locale_settings_da.pak'
-  inputs.append(os.path.join(GRIT_DIR,
-                'platform_locale_settings_%s.pak' % locale))
-
-  #e.g. '<(SHARED_INTERMEDIATE_DIR)/components/strings/
-  # component_strings_da.pak',
-  inputs.append(os.path.join(SHARE_INT_DIR, 'components', 'strings',
-                'component_strings_%s.pak' % locale))
-
-  if OS != 'ios':
-    #e.g. '<(SHARED_INTERMEDIATE_DIR)/webkit/webkit_strings_da.pak'
-    inputs.append(os.path.join(SHARE_INT_DIR, 'webkit',
-                  'webkit_strings_%s.pak' % locale))
-
-    #e.g. '<(SHARED_INTERMEDIATE_DIR)/ui/ui_strings_da.pak',
-    inputs.append(os.path.join(SHARE_INT_DIR, 'ui', 'ui_strings',
-                  'ui_strings_%s.pak' % locale))
-
-    #e.g. '<(SHARED_INTERMEDIATE_DIR)/ash_strings/ash_strings_da.pak',
-    inputs.append(os.path.join(SHARE_INT_DIR, 'ash_strings',
-                  'ash_strings_%s.pak' % locale))
-
-    #e.g. '<(SHARED_INTERMEDIATE_DIR)/device/bluetooth/strings/
-    # device_bluetooth_strings_da.pak',
-    inputs.append(os.path.join(SHARE_INT_DIR, 'device', 'bluetooth', 'strings',
-                  'device_bluetooth_strings_%s.pak' % locale))
-
-    #e.g. '<(SHARED_INTERMEDIATE_DIR)/ui/app_locale_settings_da.pak',
-    inputs.append(os.path.join(SHARE_INT_DIR, 'ui', 'app_locale_settings',
-                  'app_locale_settings_%s.pak' % locale))
-
-  #e.g. '<(grit_out_dir)/google_chrome_strings_da.pak'
-  #     or
-  #     '<(grit_out_dir)/chromium_strings_da.pak'
-  inputs.append(os.path.join(
-      GRIT_DIR, '%s_strings_%s.pak' % (BRANDING, locale)))
+  #e.g. '<(grit_out_dir)/remoting/resources/da.pak'
+  inputs.append(os.path.join(GRIT_DIR, 'remoting/resources/%s.pak' % locale))
 
   # Add any extra input files.
   for extra_file in EXTRA_INPUT_FILES:
@@ -140,16 +90,13 @@ def list_inputs(locales):
 def repack_locales(locales):
   """ Loop over and repack the given locales."""
   for locale in locales:
-    inputs = []
-    inputs += calc_inputs(locale)
+    inputs = calc_inputs(locale)
     output = calc_output(locale)
     data_pack.DataPack.RePack(output, inputs)
 
 
 def DoMain(argv):
-  global BRANDING
   global GRIT_DIR
-  global SHARE_INT_DIR
   global INT_DIR
   global OS
   global EXTRA_INPUT_FILES
@@ -163,10 +110,6 @@ def DoMain(argv):
                     help="GRIT build files output directory.")
   parser.add_option("-x", action="store", dest="int_dir",
                     help="Intermediate build files output directory.")
-  parser.add_option("-s", action="store", dest="share_int_dir",
-                    help="Shared intermediate build files output directory.")
-  parser.add_option("-b", action="store", dest="branding",
-                    help="Branding type of this build.")
   parser.add_option("-e", action="append", dest="extra_input", default=[],
                     help="Full path to an extra input pak file without the\
                          locale suffix and \".pak\" extension.")
@@ -181,8 +124,6 @@ def DoMain(argv):
   print_outputs = options.outputs
   GRIT_DIR = options.grit_dir
   INT_DIR = options.int_dir
-  SHARE_INT_DIR = options.share_int_dir
-  BRANDING = options.branding
   EXTRA_INPUT_FILES = options.extra_input
   OS = options.os
 
@@ -196,13 +137,14 @@ def DoMain(argv):
     else:
       OS = sys.platform
 
-  if not (GRIT_DIR and INT_DIR and SHARE_INT_DIR):
-    parser.error('Please specify all of "-g" and "-x" and "-s".\n')
   if print_inputs and print_outputs:
     parser.error('Please specify only one of "-i" or "-o".\n')
-  # Need to know the branding, unless we're just listing the outputs.
-  if not print_outputs and not BRANDING:
-    parser.error('Please specify "-b" to determine the input files.\n')
+  if print_inputs and not GRIT_DIR:
+    parser.error('Please specify "-g".\n')
+  if print_outputs and not INT_DIR:
+    parser.error('Please specify "-x".\n')
+  if not (print_inputs or print_outputs  or (GRIT_DIR and INT_DIR)):
+    parser.error('Please specify both "-g" and "-x".\n')
 
   if print_inputs:
     return list_inputs(locales)

Powered by Google App Engine
This is Rietveld 408576698