diff options
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/content_client_qt.cpp | 6 | ||||
-rw-r--r-- | src/core/content_client_qt.h | 1 | ||||
-rw-r--r-- | src/core/core.pro | 4 | ||||
-rw-r--r-- | src/core/resources/repack_locales.gypi | 27 | ||||
-rw-r--r-- | src/core/resources/resources.gyp | 16 |
5 files changed, 53 insertions, 1 deletions
diff --git a/src/core/content_client_qt.cpp b/src/core/content_client_qt.cpp index 46a3e9870..6a52cb5d4 100644 --- a/src/core/content_client_qt.cpp +++ b/src/core/content_client_qt.cpp @@ -43,8 +43,14 @@ #include "base/strings/string_piece.h" #include "ui/base/layout.h" +#include "ui/base/l10n/l10n_util.h" #include "ui/base/resource/resource_bundle.h" base::StringPiece ContentClientQt::GetDataResource(int resource_id, ui::ScaleFactor scale_factor) const { return ResourceBundle::GetSharedInstance().GetRawDataResourceForScale(resource_id, scale_factor); } + +base::string16 ContentClientQt::GetLocalizedString(int message_id) const +{ + return l10n_util::GetStringUTF16(message_id); +} diff --git a/src/core/content_client_qt.h b/src/core/content_client_qt.h index 059e9423b..66f302825 100644 --- a/src/core/content_client_qt.h +++ b/src/core/content_client_qt.h @@ -50,6 +50,7 @@ class ContentClientQt : public content::ContentClient { public: virtual base::StringPiece GetDataResource(int, ui::ScaleFactor) const Q_DECL_OVERRIDE; + virtual base::string16 GetLocalizedString(int message_id) const Q_DECL_OVERRIDE; }; #endif // CONTENT_CLIENT_QT_H diff --git a/src/core/core.pro b/src/core/core.pro index 3c3110257..273f2b7e7 100644 --- a/src/core/core.pro +++ b/src/core/core.pro @@ -21,8 +21,10 @@ SUBDIRS += core_gyp_generator \ gyp_run REPACK_DIR = $$getOutDir()/$$getConfigDir()/gen/repack +locales.files = $$REPACK_DIR/qtwebengine_locales +locales.path = $$[QT_INSTALL_TRANSLATIONS] resources.files = $$REPACK_DIR/qtwebengine_resources.pak resources.path = $$[QT_INSTALL_DATA] -INSTALLS += resources +INSTALLS += locales resources diff --git a/src/core/resources/repack_locales.gypi b/src/core/resources/repack_locales.gypi new file mode 100644 index 000000000..e906d2178 --- /dev/null +++ b/src/core/resources/repack_locales.gypi @@ -0,0 +1,27 @@ +# 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. + +{ + 'action_name': 'repack_locales', + 'variables': { + 'repack_extra_flags%': [], + 'repack_output_dir%': '<(SHARED_INTERMEDIATE_DIR)', + 'repack_locales_script%': ['python', '<(qtwebengine_root)/tools/buildscripts/repack_locales.py'], + }, + 'inputs': [ + '<(qtwebengine_root)/tools/buildscripts/repack_locales.py', + '<!@pymod_do_main(repack_locales -i -p <(OS) -s <(SHARED_INTERMEDIATE_DIR) -x <(repack_output_dir) <(repack_extra_flags) <(locales))' + ], + 'outputs': [ + '<!@pymod_do_main(repack_locales -o -p <(OS) -s <(SHARED_INTERMEDIATE_DIR) -x <(repack_output_dir) <(locales))' + ], + 'action': [ + '<@(repack_locales_script)', + '-p', '<(OS)', + '-s', '<(SHARED_INTERMEDIATE_DIR)', + '-x', '<(repack_output_dir)/.', + '<@(repack_extra_flags)', + '<@(locales)', + ], +} diff --git a/src/core/resources/resources.gyp b/src/core/resources/resources.gyp index 4747829ae..44ffcd703 100644 --- a/src/core/resources/resources.gyp +++ b/src/core/resources/resources.gyp @@ -1,5 +1,17 @@ { + 'variables': { + # Used in repack_locales + 'locales': [ + 'am', 'ar', 'bg', 'bn', 'ca', 'cs', 'da', 'de', 'el', 'en-GB', + 'en-US', 'es-419', 'es', 'et', 'fa', 'fi', 'fil', 'fr', 'gu', 'he', + 'hi', 'hr', 'hu', 'id', 'it', 'ja', 'kn', 'ko', 'lt', 'lv', + 'ml', 'mr', 'ms', 'nb', 'nl', 'pl', 'pt-BR', 'pt-PT', 'ro', 'ru', + 'sk', 'sl', 'sr', 'sv', 'sw', 'ta', 'te', 'th', 'tr', 'uk', + 'vi', 'zh-CN', 'zh-TW', + ], + }, 'dependencies': [ + '<(chromium_src_dir)/webkit/webkit_resources.gyp:webkit_strings', '<(chromium_src_dir)/webkit/webkit_resources.gyp:webkit_resources', '<(chromium_src_dir)/content/browser/devtools/devtools_resources.gyp:devtools_resources', ], @@ -12,6 +24,10 @@ 'action_name': 'repack_resources', 'includes': [ 'repack_resources.gypi' ], }, + { + 'action_name': 'repack_locales', + 'includes': [ 'repack_locales.gypi' ], + }, ] } ] |