| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/file_path.h" | 7 #include "base/file_path.h" |
| 8 | 8 |
| 9 namespace SpellCheckCommon { | 9 namespace SpellCheckCommon { |
| 10 | 10 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 {"el", "el-GR"}, | 24 {"el", "el-GR"}, |
| 25 {"en-AU", "en-AU"}, | 25 {"en-AU", "en-AU"}, |
| 26 {"en-GB", "en-GB"}, | 26 {"en-GB", "en-GB"}, |
| 27 {"en-US", "en-US"}, | 27 {"en-US", "en-US"}, |
| 28 {"es", "es-ES"}, | 28 {"es", "es-ES"}, |
| 29 {"et", "et-EE"}, | 29 {"et", "et-EE"}, |
| 30 {"fr", "fr-FR"}, | 30 {"fr", "fr-FR"}, |
| 31 {"he", "he-IL"}, | 31 {"he", "he-IL"}, |
| 32 {"hi", "hi-IN"}, | 32 {"hi", "hi-IN"}, |
| 33 {"hr", "hr-HR"}, | 33 {"hr", "hr-HR"}, |
| 34 {"hu", "hu-HU"}, |
| 34 {"id", "id-ID"}, | 35 {"id", "id-ID"}, |
| 35 {"it", "it-IT"}, | 36 {"it", "it-IT"}, |
| 36 {"lt", "lt-LT"}, | 37 {"lt", "lt-LT"}, |
| 37 {"lv", "lv-LV"}, | 38 {"lv", "lv-LV"}, |
| 38 {"nb", "nb-NO"}, | 39 {"nb", "nb-NO"}, |
| 39 {"nl", "nl-NL"}, | 40 {"nl", "nl-NL"}, |
| 40 {"pl", "pl-PL"}, | 41 {"pl", "pl-PL"}, |
| 41 {"pt-BR", "pt-BR"}, | 42 {"pt-BR", "pt-BR"}, |
| 42 {"pt-PT", "pt-PT"}, | 43 {"pt-PT", "pt-PT"}, |
| 43 {"ro", "ro-RO"}, | 44 {"ro", "ro-RO"}, |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 // The language input. | 77 // The language input. |
| 77 const char* language; | 78 const char* language; |
| 78 | 79 |
| 79 // The corresponding version. | 80 // The corresponding version. |
| 80 const char* version; | 81 const char* version; |
| 81 } special_version_string[] = { | 82 } special_version_string[] = { |
| 82 {"en-AU", "-1-1"}, | 83 {"en-AU", "-1-1"}, |
| 83 {"en-GB", "-1-1"}, | 84 {"en-GB", "-1-1"}, |
| 84 {"es-ES", "-1-1"}, | 85 {"es-ES", "-1-1"}, |
| 85 {"nl-NL", "-1-1"}, | 86 {"nl-NL", "-1-1"}, |
| 86 {"ru-RU", "-1-1"}, | |
| 87 {"sv-SE", "-1-1"}, | 87 {"sv-SE", "-1-1"}, |
| 88 {"he-IL", "-1-1"}, | 88 {"he-IL", "-1-1"}, |
| 89 {"el-GR", "-1-1"}, | 89 {"el-GR", "-1-1"}, |
| 90 {"hi-IN", "-1-1"}, | 90 {"hi-IN", "-1-1"}, |
| 91 {"tr-TR", "-1-1"}, | 91 {"tr-TR", "-1-1"}, |
| 92 {"et-EE", "-1-1"}, | 92 {"et-EE", "-1-1"}, |
| 93 {"fr-FR", "-1-4"}, // To fix a crash, fr dictionary was updated to 1.4. | 93 {"fr-FR", "-1-4"}, // To fix a crash, fr dictionary was updated to 1.4. |
| 94 {"lt-LT", "-1-3"}, | 94 {"lt-LT", "-1-3"}, |
| 95 {"pl-PL", "-1-3"} | 95 {"pl-PL", "-1-3"}, |
| 96 {"hu-HU", "-2-0"}, |
| 97 {"ro-RO", "-2-0"}, |
| 98 {"ru-RU", "-2-0"}, |
| 96 }; | 99 }; |
| 97 | 100 |
| 98 // Generate the bdict file name using default version string or special | 101 // Generate the bdict file name using default version string or special |
| 99 // version string, depending on the language. | 102 // version string, depending on the language. |
| 100 std::string language = GetSpellCheckLanguageRegion(input_language); | 103 std::string language = GetSpellCheckLanguageRegion(input_language); |
| 101 std::string versioned_bdict_file_name(language + kDefaultVersionString + | 104 std::string versioned_bdict_file_name(language + kDefaultVersionString + |
| 102 ".bdic"); | 105 ".bdic"); |
| 103 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(special_version_string); ++i) { | 106 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(special_version_string); ++i) { |
| 104 if (language == special_version_string[i].language) { | 107 if (language == special_version_string[i].language) { |
| 105 versioned_bdict_file_name = | 108 versioned_bdict_file_name = |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 std::string language( | 168 std::string language( |
| 166 g_supported_spellchecker_languages[i].language_region); | 169 g_supported_spellchecker_languages[i].language_region); |
| 167 if (language == input_language) | 170 if (language == input_language) |
| 168 return std::string(g_supported_spellchecker_languages[i].language); | 171 return std::string(g_supported_spellchecker_languages[i].language); |
| 169 } | 172 } |
| 170 | 173 |
| 171 return input_language; | 174 return input_language; |
| 172 } | 175 } |
| 173 | 176 |
| 174 } // namespace SpellCheckCommon | 177 } // namespace SpellCheckCommon |
| OLD | NEW |