| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // This file contains utility functions for dealing with localized | 5 // This file contains utility functions for dealing with localized |
| 6 // content. | 6 // content. |
| 7 | 7 |
| 8 #ifndef APP_L10N_UTIL_H_ | 8 #ifndef APP_L10N_UTIL_H_ |
| 9 #define APP_L10N_UTIL_H_ | 9 #define APP_L10N_UTIL_H_ |
| 10 #pragma once | 10 #pragma once |
| 11 | 11 |
| 12 #include <algorithm> | 12 #include <algorithm> |
| 13 #include <functional> | 13 #include <functional> |
| 14 #include <string> | 14 #include <string> |
| 15 #include <vector> | 15 #include <vector> |
| 16 | 16 |
| 17 #include "build/build_config.h" | 17 #include "build/build_config.h" |
| 18 | 18 |
| 19 #include "base/basictypes.h" | 19 #include "base/basictypes.h" |
| 20 #include "base/logging.h" | 20 #include "base/logging.h" |
| 21 #include "base/scoped_ptr.h" | 21 #include "base/scoped_ptr.h" |
| 22 #include "base/string16.h" | 22 #include "base/string16.h" |
| 23 #include "base/string_util.h" | 23 #include "base/string_util.h" |
| 24 | 24 |
| 25 #if defined(OS_MACOSX) | 25 #if defined(OS_MACOSX) |
| 26 #include "app/l10n_util_mac.h" | 26 #include "app/l10n_util_mac.h" |
| 27 #endif // OS_MACOSX | 27 #endif // OS_MACOSX |
| 28 | 28 |
| 29 class PrefService; | |
| 30 | |
| 31 namespace l10n_util { | 29 namespace l10n_util { |
| 32 | 30 |
| 33 // This method is responsible for determining the locale as defined below. In | 31 // This method is responsible for determining the locale as defined below. In |
| 34 // nearly all cases you shouldn't call this, rather use GetApplicationLocale | 32 // nearly all cases you shouldn't call this, rather use GetApplicationLocale |
| 35 // defined on browser_process. | 33 // defined on browser_process. |
| 36 // | 34 // |
| 37 // Returns the locale used by the Application. First we use the value from the | 35 // Returns the locale used by the Application. First we use the value from the |
| 38 // command line (--lang), second we try the value in the prefs file (passed in | 36 // command line (--lang), second we try the value in the prefs file (passed in |
| 39 // as |pref_locale|), finally, we fall back on the system locale. We only return | 37 // as |pref_locale|), finally, we fall back on the system locale. We only return |
| 40 // a value if there's a corresponding resource DLL for the locale. Otherwise, | 38 // a value if there's a corresponding resource DLL for the locale. Otherwise, |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 const std::vector<std::string>& GetAvailableLocales(); | 185 const std::vector<std::string>& GetAvailableLocales(); |
| 188 | 186 |
| 189 // Returns a vector of locale codes usable for accept-languages. | 187 // Returns a vector of locale codes usable for accept-languages. |
| 190 void GetAcceptLanguagesForLocale(const std::string& display_locale, | 188 void GetAcceptLanguagesForLocale(const std::string& display_locale, |
| 191 std::vector<std::string>* locale_codes); | 189 std::vector<std::string>* locale_codes); |
| 192 | 190 |
| 193 | 191 |
| 194 } // namespace l10n_util | 192 } // namespace l10n_util |
| 195 | 193 |
| 196 #endif // APP_L10N_UTIL_H_ | 194 #endif // APP_L10N_UTIL_H_ |
| OLD | NEW |