| 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 |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 size_t* offset); | 132 size_t* offset); |
| 133 UI_EXPORT string16 GetStringFUTF16(int message_id, | 133 UI_EXPORT string16 GetStringFUTF16(int message_id, |
| 134 const string16& a, | 134 const string16& a, |
| 135 const string16& b, | 135 const string16& b, |
| 136 std::vector<size_t>* offsets); | 136 std::vector<size_t>* offsets); |
| 137 | 137 |
| 138 // Convenience functions to get a string with a single number as a parameter. | 138 // Convenience functions to get a string with a single number as a parameter. |
| 139 UI_EXPORT string16 GetStringFUTF16Int(int message_id, int a); | 139 UI_EXPORT string16 GetStringFUTF16Int(int message_id, int a); |
| 140 string16 GetStringFUTF16Int(int message_id, int64 a); | 140 string16 GetStringFUTF16Int(int message_id, int64 a); |
| 141 | 141 |
| 142 // Get a resource string using |number| to decide which of |message_ids| should |
| 143 // be used. |message_ids| must be size 6 and in order: default, singular, zero, |
| 144 // two, few, many. |
| 145 UI_EXPORT string16 GetPluralStringFUTF16(const std::vector<int>& message_ids, |
| 146 int number); |
| 147 UI_EXPORT std::string GetPluralStringFUTF8(const std::vector<int>& message_ids, |
| 148 int number); |
| 149 |
| 142 // In place sorting of string16 strings using collation rules for |locale|. | 150 // In place sorting of string16 strings using collation rules for |locale|. |
| 143 UI_EXPORT void SortStrings16(const std::string& locale, | 151 UI_EXPORT void SortStrings16(const std::string& locale, |
| 144 std::vector<string16>* strings); | 152 std::vector<string16>* strings); |
| 145 | 153 |
| 146 // Returns a vector of available locale codes. E.g., a vector containing | 154 // Returns a vector of available locale codes. E.g., a vector containing |
| 147 // en-US, es, fr, fi, pt-PT, pt-BR, etc. | 155 // en-US, es, fr, fi, pt-PT, pt-BR, etc. |
| 148 UI_EXPORT const std::vector<std::string>& GetAvailableLocales(); | 156 UI_EXPORT const std::vector<std::string>& GetAvailableLocales(); |
| 149 | 157 |
| 150 // Returns a vector of locale codes usable for accept-languages. | 158 // Returns a vector of locale codes usable for accept-languages. |
| 151 UI_EXPORT void GetAcceptLanguagesForLocale( | 159 UI_EXPORT void GetAcceptLanguagesForLocale( |
| 152 const std::string& display_locale, | 160 const std::string& display_locale, |
| 153 std::vector<std::string>* locale_codes); | 161 std::vector<std::string>* locale_codes); |
| 154 | 162 |
| 155 // Returns the preferred size of the contents view of a window based on | 163 // Returns the preferred size of the contents view of a window based on |
| 156 // designer given constraints which might dependent on the language used. | 164 // designer given constraints which might dependent on the language used. |
| 157 UI_EXPORT int GetLocalizedContentsWidthInPixels(int pixel_resource_id); | 165 UI_EXPORT int GetLocalizedContentsWidthInPixels(int pixel_resource_id); |
| 158 | 166 |
| 159 } // namespace l10n_util | 167 } // namespace l10n_util |
| 160 | 168 |
| 161 #endif // UI_BASE_L10N_L10N_UTIL_H_ | 169 #endif // UI_BASE_L10N_L10N_UTIL_H_ |
| OLD | NEW |