diff options
author | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-26 23:18:23 +0000 |
---|---|---|
committer | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-26 23:18:23 +0000 |
commit | 37f881f80d889d817d5ded8d5393faa268eb5193 (patch) | |
tree | a9ee41a4a1ea7f9b20da7bcfac796cce62394b4a | |
parent | 8ab8ff072cbfb539f594425233a3805367733e42 (diff) | |
download | chromium_src-37f881f80d889d817d5ded8d5393faa268eb5193.zip chromium_src-37f881f80d889d817d5ded8d5393faa268eb5193.tar.gz chromium_src-37f881f80d889d817d5ded8d5393faa268eb5193.tar.bz2 |
Fix a NOTIMPLEMENTED() in l10n_util.cc from it expecting .dll in the file name.
While I'm at it, remove references to .dll in comments in the file.
Review URL: http://codereview.chromium.org/27223
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10524 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/common/l10n_util.cc | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/chrome/common/l10n_util.cc b/chrome/common/l10n_util.cc index a337208..3926796 100644 --- a/chrome/common/l10n_util.cc +++ b/chrome/common/l10n_util.cc @@ -27,6 +27,12 @@ namespace { +#if defined(OS_WIN) +static const FilePath::CharType kLocaleFileExtension[] = L".dll"; +#elif defined(OS_POSIX) +static const FilePath::CharType kLocaleFileExtension[] = ".pak"; +#endif + // Added to the end of strings that are too big in TrucateString. static const wchar_t* const kElideString = L"\x2026"; @@ -44,7 +50,7 @@ void GetLanguageAndRegionFromOS(std::string* lang, std::string* region) { *region = country; } -// Convert Chrome locale name (DLL name) to ICU locale name +// Convert Chrome locale name to ICU locale name std::string ICULocaleName(const std::wstring& locale_string) { // If not Spanish, just return it. if (locale_string.substr(0, 2) != L"es") @@ -116,13 +122,14 @@ bool IsLocaleAvailable(const std::wstring& locale, const std::wstring& locale_path) { std::wstring test_locale = locale; // If locale has any illegal characters in it, we don't want to try to - // load it because it may be pointing outside the locale dll directory. + // load it because it may be pointing outside the locale data file directory. file_util::ReplaceIllegalCharacters(&test_locale, ' '); if (test_locale != locale) return false; - std::wstring test_path = locale_path; - file_util::AppendToPath(&test_path, locale + L".dll"); + FilePath test_path = FilePath::FromWStringHack(locale_path) + .Append(FilePath::FromWStringHack(locale)) + .ReplaceExtension(kLocaleFileExtension); return file_util::PathExists(test_path) && SetICUDefaultLocale(locale); } @@ -239,13 +246,8 @@ std::wstring GetApplicationLocale(const std::wstring& pref_locale) { if (IsLocaleAvailable(fallback_locale, locale_path)) return fallback_locale; -#if defined(OS_WIN) - // No DLL, we shouldn't get here. + // No locale data file was found; we shouldn't get here. NOTREACHED(); -#else - // We need a locale data file. - NOTIMPLEMENTED(); -#endif return std::wstring(); } @@ -651,7 +653,7 @@ const std::vector<std::wstring>& GetAvailableLocales() { // Filter out the names that have aliases. if (IsDuplicateName(locale_name)) continue; - // Normalize underscores to hyphens because that's what our locale dlls + // Normalize underscores to hyphens because that's what our locale files // use. std::replace(locale_name.begin(), locale_name.end(), '_', '-'); |