OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 UI_BASE_L10N_L10N_UTIL_H_ | 8 #ifndef UI_BASE_L10N_L10N_UTIL_H_ |
9 #define UI_BASE_L10N_L10N_UTIL_H_ | 9 #define UI_BASE_L10N_L10N_UTIL_H_ |
10 | 10 |
11 #include <string> | 11 #include <string> |
12 #include <vector> | 12 #include <vector> |
13 | 13 |
14 #include "base/string16.h" | 14 #include "base/string16.h" |
15 #include "base/string_util.h" | 15 #include "base/string_util.h" |
16 #include "ui/base/ui_export.h" | 16 #include "ui/base/ui_export.h" |
17 | 17 |
18 #if defined(OS_MACOSX) | 18 #if defined(OS_MACOSX) |
19 #include "ui/base/l10n/l10n_util_mac.h" | 19 #include "ui/base/l10n/l10n_util_mac.h" |
20 #endif // OS_MACOSX | 20 #endif // OS_MACOSX |
21 | 21 |
22 namespace l10n_util { | 22 namespace l10n_util { |
23 | 23 |
24 // Returns true if a display name for |locale| is available in the locale | |
25 // |display_locale|. | |
26 bool IsLocaleNameTranslated(const std::string& locale, | |
Takashi Toyoshima
2013/05/21 11:11:43
UI_EXPORT
hajimehoshi
2013/05/22 04:19:27
Done.
| |
27 const std::string& display_locale); | |
28 | |
24 // This method is responsible for determining the locale as defined below. In | 29 // This method is responsible for determining the locale as defined below. In |
25 // nearly all cases you shouldn't call this, rather use GetApplicationLocale | 30 // nearly all cases you shouldn't call this, rather use GetApplicationLocale |
26 // defined on browser_process. | 31 // defined on browser_process. |
27 // | 32 // |
28 // Returns the locale used by the Application. First we use the value from the | 33 // Returns the locale used by the Application. First we use the value from the |
29 // command line (--lang), second we try the value in the prefs file (passed in | 34 // command line (--lang), second we try the value in the prefs file (passed in |
30 // as |pref_locale|), finally, we fall back on the system locale. We only return | 35 // as |pref_locale|), finally, we fall back on the system locale. We only return |
31 // a value if there's a corresponding resource DLL for the locale. Otherwise, | 36 // a value if there's a corresponding resource DLL for the locale. Otherwise, |
32 // we fall back to en-us. | 37 // we fall back to en-us. |
33 UI_EXPORT std::string GetApplicationLocale(const std::string& pref_locale); | 38 UI_EXPORT std::string GetApplicationLocale(const std::string& pref_locale); |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
147 const std::string& display_locale, | 152 const std::string& display_locale, |
148 std::vector<std::string>* locale_codes); | 153 std::vector<std::string>* locale_codes); |
149 | 154 |
150 // Returns the preferred size of the contents view of a window based on | 155 // Returns the preferred size of the contents view of a window based on |
151 // designer given constraints which might dependent on the language used. | 156 // designer given constraints which might dependent on the language used. |
152 UI_EXPORT int GetLocalizedContentsWidthInPixels(int pixel_resource_id); | 157 UI_EXPORT int GetLocalizedContentsWidthInPixels(int pixel_resource_id); |
153 | 158 |
154 } // namespace l10n_util | 159 } // namespace l10n_util |
155 | 160 |
156 #endif // UI_BASE_L10N_L10N_UTIL_H_ | 161 #endif // UI_BASE_L10N_L10N_UTIL_H_ |
OLD | NEW |