]> khamidou — GitHub mirrors - electron.git/commitdiff
browser: provide localized string from resourcebundle
authorRobo <hop2deep@gmail.com>
Wed, 30 Dec 2015 05:16:22 +0000 (10:46 +0530)
committerRobo <hop2deep@gmail.com>
Wed, 30 Dec 2015 05:28:46 +0000 (10:58 +0530)
atom.gyp
atom/app/atom_content_client.cc
atom/app/atom_content_client.h

index 3f76dd4613efc877c5eb78ebbb1f9f1faa627c18..83605eedbc0d825345cbb8450fba0f5c10e696e9 100644 (file)
--- a/atom.gyp
+++ b/atom.gyp
               ],
             }],
           ],
-        }, {  # OS=="mac"
-          'dependencies': [
-            'make_locale_paks',
-          ],
         }],  # OS!="mac"
         ['OS=="win"', {
           'include_dirs': [
               'destination': '<(PRODUCT_DIR)',
               'files': [
                 '<@(copied_libraries)',
+                '<(libchromiumcontent_dir)/locales',
                 '<(libchromiumcontent_dir)/libEGL.dll',
                 '<(libchromiumcontent_dir)/libGLESv2.dll',
                 '<(libchromiumcontent_dir)/icudtl.dat',
               'destination': '<(PRODUCT_DIR)',
               'files': [
                 '<@(copied_libraries)',
+                '<(libchromiumcontent_dir)/locales',
                 '<(libchromiumcontent_dir)/icudtl.dat',
                 '<(libchromiumcontent_dir)/content_shell.pak',
                 '<(libchromiumcontent_dir)/natives_blob.bin',
           'mac_bundle': 1,
           'mac_bundle_resources': [
             'atom/common/resources/mac/MainMenu.xib',
+            '<(libchromiumcontent_dir)/locales',
             '<(libchromiumcontent_dir)/content_shell.pak',
             '<(libchromiumcontent_dir)/icudtl.dat',
             '<(libchromiumcontent_dir)/natives_blob.bin',
           },
         },  # target helper
       ],
-    }, {  # OS=="mac"
-      'targets': [
-        {
-          'target_name': 'make_locale_paks',
-          'type': 'none',
-          'actions': [
-            {
-              'action_name': 'Make Empty Paks',
-              'inputs': [
-                'tools/make_locale_paks.py',
-              ],
-              'outputs': [
-                '<(PRODUCT_DIR)/locales'
-              ],
-              'action': [
-                'python',
-                'tools/make_locale_paks.py',
-                '<(PRODUCT_DIR)',
-                '<@(locales)',
-              ],
-              'msvs_cygwin_shell': 0,
-            },
-          ],
-        },
-      ],
     }],  # OS!="mac"
   ],
 }
index 997f66447ce9e363af187de0111973827442b08e..25e9d0f1932af30296de26c5fb0013e09a99c19c 100644 (file)
@@ -20,6 +20,7 @@
 #include "content/public/common/user_agent.h"
 #include "ppapi/shared_impl/ppapi_permissions.h"
 #include "third_party/widevine/cdm/stub/widevine_cdm_version.h"
+#include "ui/base/l10n/l10n_util.h"
 #include "url/url_constants.h"
 
 #if defined(WIDEVINE_CDM_AVAILABLE) && defined(ENABLE_PEPPER_CDMS)
@@ -175,6 +176,10 @@ std::string AtomContentClient::GetUserAgent() const {
       ATOM_PRODUCT_NAME "/" ATOM_VERSION_STRING);
 }
 
+base::string16 AtomContentClient::GetLocalizedString(int message_id) const {
+  return l10n_util::GetStringUTF16(message_id);
+}
+
 void AtomContentClient::AddAdditionalSchemes(
     std::vector<url::SchemeWithType>* standard_schemes,
     std::vector<std::string>* savable_schemes) {
index 76ac37642a7162e2fa53a0761f6eae60c47305e1..33dbe19d990e6d3030d075f136e591c303b9432f 100644 (file)
@@ -22,6 +22,7 @@ class AtomContentClient : public brightray::ContentClient {
   // content::ContentClient:
   std::string GetProduct() const override;
   std::string GetUserAgent() const override;
+  base::string16 GetLocalizedString(int message_id) const override;
   void AddAdditionalSchemes(
       std::vector<url::SchemeWithType>* standard_schemes,
       std::vector<std::string>* savable_schemes) override;