OLD | NEW |
1 // Copyright (c) 2010 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 |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 std::vector<size_t>* offsets); | 176 std::vector<size_t>* offsets); |
177 #endif | 177 #endif |
178 string16 GetStringFUTF16(int message_id, | 178 string16 GetStringFUTF16(int message_id, |
179 const string16& a, | 179 const string16& a, |
180 size_t* offset); | 180 size_t* offset); |
181 string16 GetStringFUTF16(int message_id, | 181 string16 GetStringFUTF16(int message_id, |
182 const string16& a, | 182 const string16& a, |
183 const string16& b, | 183 const string16& b, |
184 std::vector<size_t>* offsets); | 184 std::vector<size_t>* offsets); |
185 | 185 |
186 // Convenience formatters for a single number. | 186 // Convenience functions to get a string with a single number as a parameter. |
187 #if CRBUG_9911_OBSOLETE_GOING_AWAY | 187 #if CRBUG_9911_OBSOLETE_GOING_AWAY |
188 std::wstring GetStringF(int message_id, int a); | 188 std::wstring GetStringF(int message_id, int a); |
189 std::wstring GetStringF(int message_id, int64 a); | 189 std::wstring GetStringF(int message_id, int64 a); |
190 #endif | 190 #endif |
191 string16 GetStringFUTF16(int message_id, int a); | 191 string16 GetStringFUTF16Int(int message_id, int a); |
192 string16 GetStringFUTF16(int message_id, int64 a); | 192 string16 GetStringFUTF16Int(int message_id, int64 a); |
193 | 193 |
194 // Truncates the string to length characters. This breaks the string at | 194 // Truncates the string to length characters. This breaks the string at |
195 // the first word break before length, adding the horizontal ellipsis | 195 // the first word break before length, adding the horizontal ellipsis |
196 // character (unicode character 0x2026) to render ... | 196 // character (unicode character 0x2026) to render ... |
197 // The supplied string is returned if the string has length characters or | 197 // The supplied string is returned if the string has length characters or |
198 // less. | 198 // less. |
199 string16 TruncateString(const string16& string, size_t length); | 199 string16 TruncateString(const string16& string, size_t length); |
200 | 200 |
201 // Returns the lower case equivalent of string. | 201 // Returns the lower case equivalent of string. |
202 string16 ToLower(const string16& string); | 202 string16 ToLower(const string16& string); |
(...skipping 10 matching lines...) Expand all Loading... |
213 const std::vector<std::string>& GetAvailableLocales(); | 213 const std::vector<std::string>& GetAvailableLocales(); |
214 | 214 |
215 // Returns a vector of locale codes usable for accept-languages. | 215 // Returns a vector of locale codes usable for accept-languages. |
216 void GetAcceptLanguagesForLocale(const std::string& display_locale, | 216 void GetAcceptLanguagesForLocale(const std::string& display_locale, |
217 std::vector<std::string>* locale_codes); | 217 std::vector<std::string>* locale_codes); |
218 | 218 |
219 | 219 |
220 } // namespace l10n_util | 220 } // namespace l10n_util |
221 | 221 |
222 #endif // APP_L10N_UTIL_H_ | 222 #endif // APP_L10N_UTIL_H_ |
OLD | NEW |