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 #include "ui/base/l10n/l10n_util.h" | 5 #include "ui/base/l10n/l10n_util.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cstdlib> | 8 #include <cstdlib> |
9 #include <iterator> | 9 #include <iterator> |
10 #include <string> | 10 #include <string> |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 "pt", // pt-BR and pt-PT are used. | 194 "pt", // pt-BR and pt-PT are used. |
195 "zh", | 195 "zh", |
196 "zh_hans_cn", | 196 "zh_hans_cn", |
197 "zh_hant_hk", | 197 "zh_hant_hk", |
198 "zh_hant_mo", | 198 "zh_hant_mo", |
199 "zh_hans_sg", | 199 "zh_hans_sg", |
200 "zh_hant_tw" | 200 "zh_hant_tw" |
201 }; | 201 }; |
202 | 202 |
203 // Skip all the es_Foo other than es_419 for now. | 203 // Skip all the es_Foo other than es_419 for now. |
204 if (base::StartsWith(locale_name, "es_", | 204 if (base::StartsWithASCII(locale_name, "es_", false)) |
205 base::CompareCase::INSENSITIVE_ASCII)) | 205 return !base::EndsWith(locale_name, "419", true); |
206 return !base::EndsWith(locale_name, "419", base::CompareCase::SENSITIVE); | |
207 | 206 |
208 for (size_t i = 0; i < arraysize(kDuplicateNames); ++i) { | 207 for (size_t i = 0; i < arraysize(kDuplicateNames); ++i) { |
209 if (base::EqualsCaseInsensitiveASCII(kDuplicateNames[i], locale_name)) | 208 if (base::EqualsCaseInsensitiveASCII(kDuplicateNames[i], locale_name)) |
210 return true; | 209 return true; |
211 } | 210 } |
212 return false; | 211 return false; |
213 } | 212 } |
214 | 213 |
215 // We added 30+ minimally populated locales with only a few entries | 214 // We added 30+ minimally populated locales with only a few entries |
216 // (exemplar character set, script, writing direction and its own | 215 // (exemplar character set, script, writing direction and its own |
(...skipping 657 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
874 | 873 |
875 const char* const* GetAcceptLanguageListForTesting() { | 874 const char* const* GetAcceptLanguageListForTesting() { |
876 return kAcceptLanguageList; | 875 return kAcceptLanguageList; |
877 } | 876 } |
878 | 877 |
879 size_t GetAcceptLanguageListSizeForTesting() { | 878 size_t GetAcceptLanguageListSizeForTesting() { |
880 return arraysize(kAcceptLanguageList); | 879 return arraysize(kAcceptLanguageList); |
881 } | 880 } |
882 | 881 |
883 } // namespace l10n_util | 882 } // namespace l10n_util |
OLD | NEW |