Chromium Code Reviews| 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 "chrome/common/spellcheck_common.h" | 5 #include "chrome/common/spellcheck_common.h" |
| 6 | 6 |
| 7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "third_party/icu/source/common/unicode/uloc.h" | 9 #include "third_party/icu/source/common/unicode/uloc.h" |
| 10 | 10 |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 101 // dictionaries that you add at the same time. Increment the major version | 101 // dictionaries that you add at the same time. Increment the major version |
| 102 // number if you're updating either dic or aff files. Increment the minor | 102 // number if you're updating either dic or aff files. Increment the minor |
| 103 // version number if you're updating only dic_delta files. | 103 // version number if you're updating only dic_delta files. |
| 104 static LanguageVersion special_version_string[] = { | 104 static LanguageVersion special_version_string[] = { |
| 105 {"tr-TR", "-4-0"}, // Jan 9, 2013: Add "FLAG num" to aff to avoid heapcheck | 105 {"tr-TR", "-4-0"}, // Jan 9, 2013: Add "FLAG num" to aff to avoid heapcheck |
| 106 // crash. | 106 // crash. |
| 107 {"tg-TG", "-5-0"}, // Mar 4, 2014: Add Tajik dictionary. | 107 {"tg-TG", "-5-0"}, // Mar 4, 2014: Add Tajik dictionary. |
| 108 | 108 |
| 109 // Oct 28, 2014: Update from upstream, add new words. | 109 // Oct 28, 2014: Update from upstream, add new words. |
| 110 {"en-AU", "-4-0"}, | 110 {"en-AU", "-4-0"}, |
| 111 {"en-CA", "-4-0"}, | |
| 112 {"en-GB", "-4-0"}, | 111 {"en-GB", "-4-0"}, |
|
groby-ooo-7-16
2015/03/12 21:08:07
Australians and British peeps don't get typography
| |
| 113 {"en-US", "-4-0"}, | 112 |
| 113 // March 10, 2015: Update from upstream, enable typographical apostrophe. | |
| 114 {"en-CA", "-6-1"}, | |
| 115 {"en-US", "-6-1"}, | |
| 114 }; | 116 }; |
| 115 | 117 |
| 116 // Generate the bdict file name using default version string or special | 118 // Generate the bdict file name using default version string or special |
| 117 // version string, depending on the language. | 119 // version string, depending on the language. |
| 118 std::string language = GetSpellCheckLanguageRegion(input_language); | 120 std::string language = GetSpellCheckLanguageRegion(input_language); |
| 119 std::string versioned_bdict_file_name(language + kDefaultVersionString + | 121 std::string versioned_bdict_file_name(language + kDefaultVersionString + |
| 120 ".bdic"); | 122 ".bdic"); |
| 121 for (size_t i = 0; i < arraysize(special_version_string); ++i) { | 123 for (size_t i = 0; i < arraysize(special_version_string); ++i) { |
| 122 if (language == special_version_string[i].language) { | 124 if (language == special_version_string[i].language) { |
| 123 versioned_bdict_file_name = | 125 versioned_bdict_file_name = |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 171 error = U_ZERO_ERROR; | 173 error = U_ZERO_ERROR; |
| 172 uloc_getLanguage(id, language, arraysize(language), &error); | 174 uloc_getLanguage(id, language, arraysize(language), &error); |
| 173 country = uloc_getISO3Country(id); | 175 country = uloc_getISO3Country(id); |
| 174 } | 176 } |
| 175 *language_code = std::string(language); | 177 *language_code = std::string(language); |
| 176 *country_code = std::string(country); | 178 *country_code = std::string(country); |
| 177 } | 179 } |
| 178 | 180 |
| 179 } // namespace spellcheck_common | 181 } // namespace spellcheck_common |
| 180 } // namespace chrome | 182 } // namespace chrome |
| OLD | NEW |