diff options
author | ofri@google.com <ofri@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-24 14:53:50 +0000 |
---|---|---|
committer | ofri@google.com <ofri@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-24 14:53:50 +0000 |
commit | ae5dda7261973def9810e6b4e72346d8d96cf7ca (patch) | |
tree | a8348d039e02d7203fe0b14030c0c720e14d7879 /ui | |
parent | 1f8110b02d73ffdd890f085a42fb6f155bc3073f (diff) | |
download | chromium_src-ae5dda7261973def9810e6b4e72346d8d96cf7ca.zip chromium_src-ae5dda7261973def9810e6b4e72346d8d96cf7ca.tar.gz chromium_src-ae5dda7261973def9810e6b4e72346d8d96cf7ca.tar.bz2 |
Adding support for loading custom locale resources using a command line flag.
Loading pseudo-locale will now be done by passing --lang=myLocale --locale_res_path=path/to/pseudo-locale.pak
This patch doesn't work on Windows.
BUG=73052
TEST=NONE
Review URL: http://codereview.chromium.org/7033022
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@86426 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui')
-rw-r--r-- | ui/base/resource/resource_bundle_posix.cc | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/ui/base/resource/resource_bundle_posix.cc b/ui/base/resource/resource_bundle_posix.cc index d2fe55b..c62983a1 100644 --- a/ui/base/resource/resource_bundle_posix.cc +++ b/ui/base/resource/resource_bundle_posix.cc @@ -4,6 +4,9 @@ #include "ui/base/resource/resource_bundle.h" +#include "base/base_switches.h" +#include "base/command_line.h" +#include "base/file_path.h" #include "base/logging.h" #include "base/stl_util-inl.h" #include "base/string16.h" @@ -112,7 +115,14 @@ std::string ResourceBundle::LoadLocaleResources( const std::string& pref_locale) { DCHECK(!locale_resources_data_) << "locale.pak already loaded"; std::string app_locale = l10n_util::GetApplicationLocale(pref_locale); - FilePath locale_file_path = GetLocaleFilePath(app_locale); + FilePath locale_file_path; + CommandLine *command_line = CommandLine::ForCurrentProcess(); + if (command_line->HasSwitch(switches::kLocalePak)) { + locale_file_path = + command_line->GetSwitchValuePath(switches::kLocalePak); + } else { + locale_file_path = GetLocaleFilePath(app_locale); + } if (locale_file_path.empty()) { // It's possible that there is no locale.pak. NOTREACHED(); |