Skip to content

Commit

Permalink
[Chromoting] Include AppRemoting HTML/JS files in the localization ch…
Browse files Browse the repository at this point in the history
…eck.

Move duplicate locale-related gyp vars into a separate .gypi.
Add gyp vars that contain the set of localizable html/js files.
Remove remoting_host_locale_files since it is not used anywhere.

BUG=

Review URL: https://codereview.chromium.org/875083004

Cr-Commit-Position: refs/heads/master@{#313284}
  • Loading branch information
garykac authored and Commit bot committed Jan 27, 2015
1 parent d394b56 commit 9ab9df4
Show file tree
Hide file tree
Showing 6 changed files with 126 additions and 107 deletions.
3 changes: 2 additions & 1 deletion remoting/app_remoting_webapp.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@

{
'includes': [
'<(DEPTH)/remoting/app_remoting_webapp_build.gypi',
'../remoting/remoting_locales.gypi',
'../remoting/app_remoting_webapp_build.gypi',
],

'target_defaults': {
Expand Down
82 changes: 2 additions & 80 deletions remoting/app_remoting_webapp_build.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
{
'includes': [
'remoting_version.gypi',
'remoting_locales.gypi',
'remoting_webapp_files.gypi',
'app_remoting_webapp_files.gypi',
],

'variables': {
Expand All @@ -16,86 +18,6 @@
# This variable is used to define the target environment for the app
# being built. The allowed values are dev, test, staging, and prod.
'ar_service_environment%': 'dev',

'remoting_localize_path': 'tools/build/remoting_localize.py',

# TODO(wez): Split into shared-stub and app-specific resources.
'webapp_locale_dir': '<(SHARED_INTERMEDIATE_DIR)/remoting/webapp/_locales',
'remoting_locales': [
'en',
],
'remoting_webapp_locale_files': [
# Build the list of .json files generated from remoting_strings.grd.
'<!@pymod_do_main(remoting_localize --locale_output '
'"<(webapp_locale_dir)/@{json_suffix}/messages.json" '
'--print_only <(remoting_locales))',
],

'ar_shared_resource_files': [
'webapp/app_remoting/html/ar_dialog.css',
'webapp/app_remoting/html/feedback_consent.css',
'webapp/app_remoting/html/feedback_consent.html',
'webapp/app_remoting/html/context_menu.css',
'resources/drag.webp',
'<@(remoting_webapp_resource_files)',
],

# Variables for main.html.
# These template files are used to construct the webapp html files.
'ar_main_template':
'<(DEPTH)/remoting/webapp/app_remoting/html/template_lg.html',
'ar_main_template_files': [
'webapp/base/html/client_plugin.html',
'webapp/base/html/dialog_auth.html',
'webapp/app_remoting/html/context_menu.html',
'webapp/app_remoting/html/idle_dialog.html',
],
'ar_main_js_files': [
'webapp/app_remoting/js/application_context_menu.js',
'webapp/app_remoting/js/app_remoting.js',
'webapp/app_remoting/js/ar_main.js',
'webapp/app_remoting/js/context_menu_adapter.js',
'webapp/app_remoting/js/context_menu_chrome.js',
'webapp/app_remoting/js/context_menu_dom.js',
'webapp/app_remoting/js/drag_and_drop.js',
'webapp/app_remoting/js/idle_detector.js',
'webapp/app_remoting/js/keyboard_layouts_menu.js',
'webapp/app_remoting/js/loading_window.js',
'webapp/app_remoting/js/submenu_manager.js',
'webapp/app_remoting/js/window_activation_menu.js',
'webapp/base/js/application.js',
'webapp/base/js/auth_dialog.js',
'webapp/base/js/base.js',
'webapp/base/js/message_window_helper.js',
'webapp/base/js/message_window_manager.js',
'<@(remoting_webapp_js_auth_client2host_files)',
'<@(remoting_webapp_js_auth_google_files)',
'<@(remoting_webapp_js_cast_extension_files)',
'<@(remoting_webapp_js_client_files)',
'<@(remoting_webapp_js_core_files)',
'<@(remoting_webapp_js_gnubby_auth_files)',
'<@(remoting_webapp_js_host_files)',
'<@(remoting_webapp_js_logging_files)',
'<@(remoting_webapp_js_signaling_files)',
'<@(remoting_webapp_js_ui_files)',
],

'ar_background_js_files': [
'webapp/app_remoting/js/ar_background.js',
'webapp/base/js/platform.js',
],

'ar_all_js_files': [
'<@(ar_main_js_files)',
# Referenced from wcs_sandbox.html.
'<@(remoting_webapp_js_wcs_sandbox_files)',
# Referenced from the manifest.
'<@(ar_background_js_files)',
# Referenced from feedback_consent.html.
'webapp/app_remoting/js/feedback_consent.js',
# Referenced from message_window.html.
'webapp/base/js/message_window.js',
],
}, # end of variables

'target_defaults': {
Expand Down
82 changes: 82 additions & 0 deletions remoting/app_remoting_webapp_files.gypi
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# Copyright 2015 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.

{
'variables': {
'ar_shared_resource_files': [
'webapp/app_remoting/html/ar_dialog.css',
'webapp/app_remoting/html/feedback_consent.css',
'webapp/app_remoting/html/feedback_consent.html',
'webapp/app_remoting/html/context_menu.css',
'resources/drag.webp',
'<@(remoting_webapp_resource_files)',
],

# Variables for main.html.
# These template files are used to construct the webapp html files.
'ar_main_template':
'<(DEPTH)/remoting/webapp/app_remoting/html/template_lg.html',
'ar_main_template_files': [
'webapp/base/html/client_plugin.html',
'webapp/base/html/dialog_auth.html',
'webapp/app_remoting/html/context_menu.html',
'webapp/app_remoting/html/idle_dialog.html',
],
'ar_main_js_files': [
'webapp/app_remoting/js/application_context_menu.js',
'webapp/app_remoting/js/app_remoting.js',
'webapp/app_remoting/js/ar_main.js',
'webapp/app_remoting/js/context_menu_adapter.js',
'webapp/app_remoting/js/context_menu_chrome.js',
'webapp/app_remoting/js/context_menu_dom.js',
'webapp/app_remoting/js/drag_and_drop.js',
'webapp/app_remoting/js/idle_detector.js',
'webapp/app_remoting/js/keyboard_layouts_menu.js',
'webapp/app_remoting/js/loading_window.js',
'webapp/app_remoting/js/submenu_manager.js',
'webapp/app_remoting/js/window_activation_menu.js',
'webapp/base/js/application.js',
'webapp/base/js/auth_dialog.js',
'webapp/base/js/base.js',
'webapp/base/js/message_window_helper.js',
'webapp/base/js/message_window_manager.js',
'<@(remoting_webapp_js_auth_client2host_files)',
'<@(remoting_webapp_js_auth_google_files)',
'<@(remoting_webapp_js_cast_extension_files)',
'<@(remoting_webapp_js_client_files)',
'<@(remoting_webapp_js_core_files)',
'<@(remoting_webapp_js_gnubby_auth_files)',
'<@(remoting_webapp_js_host_files)',
'<@(remoting_webapp_js_logging_files)',
'<@(remoting_webapp_js_signaling_files)',
'<@(remoting_webapp_js_ui_files)',
],

'ar_background_js_files': [
'webapp/app_remoting/js/ar_background.js',
'webapp/base/js/platform.js',
],

'ar_all_js_files': [
'<@(ar_main_js_files)',
# Referenced from wcs_sandbox.html.
'<@(remoting_webapp_js_wcs_sandbox_files)',
# Referenced from the manifest.
'<@(ar_background_js_files)',
# Referenced from feedback_consent.html.
'webapp/app_remoting/js/feedback_consent.js',
# Referenced from message_window.html.
'webapp/base/js/message_window.js',
],

# Files that contain localizable strings.
'app_remoting_webapp_localizable_files': [
'<(ar_main_template)',
'<@(ar_main_template_files)',
'webapp/app_remoting/html/feedback_consent.html',
'<@(ar_all_js_files)',
],

}, # end of variables
}
30 changes: 4 additions & 26 deletions remoting/remoting.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,8 @@
'remoting_multi_process%': '<(remoting_multi_process)',
'remoting_rdp_session%': 1,

'remoting_localize_path': 'tools/build/remoting_localize.py',

'branding_path': '../remoting/branding_<(branding)',

'webapp_locale_dir': '<(SHARED_INTERMEDIATE_DIR)/remoting/webapp/_locales',

'conditions': [
['OS=="mac"', {
'mac_bundle_id': '<!(python <(version_py_path) -f <(branding_path) -t "@MAC_BUNDLE_ID@")',
Expand All @@ -55,25 +51,6 @@

}],
],
'remoting_locales': [
# Note: list duplicated in GN build. See //remoting/resources/BUILD.gn
'ar', 'bg', 'ca', 'cs', 'da', 'de', 'el', 'en', 'en-GB', 'es',
'es-419', 'et', 'fi', 'fil', 'fr', 'he', 'hi', 'hr', 'hu', 'id',
'it', 'ja', 'ko', 'lt', 'lv', 'nb', 'nl', 'pl', 'pt-BR', 'pt-PT',
'ro', 'ru', 'sk', 'sl', 'sr', 'sv', 'th', 'tr', 'uk', 'vi',
'zh-CN', 'zh-TW',
],
'remoting_host_locale_files': [
# Build the list of .pak files generated from remoting_strings.grd.
'<!@pymod_do_main(remoting_copy_locales -o -p <(OS) -x '
'<(PRODUCT_DIR) <(remoting_locales))',
],
'remoting_webapp_locale_files': [
# Build the list of .json files generated from remoting_strings.grd.
'<!@pymod_do_main(remoting_localize --locale_output '
'"<(webapp_locale_dir)/@{json_suffix}/messages.json" '
'--print_only <(remoting_locales))',
],
},

'includes': [
Expand All @@ -82,10 +59,12 @@
'remoting_client.gypi',
'remoting_host.gypi',
'remoting_host_srcs.gypi',
'remoting_locales.gypi',
'remoting_srcs.gypi',
'remoting_test.gypi',
'remoting_version.gypi',
'remoting_webapp_files.gypi',
'app_remoting_webapp_files.gypi',
],

'target_defaults': {
Expand Down Expand Up @@ -165,7 +144,6 @@
'variables': {
'grit_out_dir': '<(SHARED_INTERMEDIATE_DIR)',
'sources': [
'<(SHARED_INTERMEDIATE_DIR)/main.html',
'base/resources_unittest.cc',
'host/continue_window_mac.mm',
'host/disconnect_window_mac.mm',
Expand All @@ -176,8 +154,8 @@
'host/win/host_messages.mc.jinja2',
'host/win/version.rc.jinja2',
'resources/play_store_resources.cc',
'webapp/crd/manifest.json.jinja2',
'<@(remoting_webapp_crd_js_files)',
'<@(desktop_remoting_webapp_localizable_files)',
'<@(app_remoting_webapp_localizable_files)',
],
},
'actions': [
Expand Down
26 changes: 26 additions & 0 deletions remoting/remoting_locales.gypi
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Copyright 2015 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.

{
'variables': {
'remoting_localize_path': 'tools/build/remoting_localize.py',

'webapp_locale_dir': '<(SHARED_INTERMEDIATE_DIR)/remoting/webapp/_locales',

'remoting_locales': [
# Note: list duplicated in GN build. See //remoting/resources/BUILD.gn
'ar', 'bg', 'ca', 'cs', 'da', 'de', 'el', 'en', 'en-GB', 'es',
'es-419', 'et', 'fi', 'fil', 'fr', 'he', 'hi', 'hr', 'hu', 'id',
'it', 'ja', 'ko', 'lt', 'lv', 'nb', 'nl', 'pl', 'pt-BR', 'pt-PT',
'ro', 'ru', 'sk', 'sl', 'sr', 'sv', 'th', 'tr', 'uk', 'vi',
'zh-CN', 'zh-TW',
],
'remoting_webapp_locale_files': [
# Build the list of .json files generated from remoting_strings.grd.
'<!@pymod_do_main(remoting_localize --locale_output '
'"<(webapp_locale_dir)/@{json_suffix}/messages.json" '
'--print_only <(remoting_locales))',
],
}, # variables
}
10 changes: 10 additions & 0 deletions remoting/remoting_webapp_files.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -350,5 +350,15 @@
'webapp/crd/html/window_frame.html',
],

# Files that contain localizable strings.
'desktop_remoting_webapp_localizable_files': [
'webapp/crd/manifest.json.jinja2',
'<(remoting_webapp_template_main)',
'<(remoting_webapp_template_wcs_sandbox)',
'<(remoting_webapp_template_background)',
'<@(remoting_webapp_template_files)',
'<@(remoting_webapp_crd_js_files)',
],

},
}

0 comments on commit 9ab9df4

Please sign in to comment.