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/file_path.h" | 7 #include "base/file_path.h" |
8 | 8 |
9 namespace chrome { | 9 namespace chrome { |
10 namespace spellcheck_common { | 10 namespace spellcheck_common { |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 const FilePath& dict_dir) { | 92 const FilePath& dict_dir) { |
93 // The default dictionary version is 3-0. This version indicates that the bdic | 93 // The default dictionary version is 3-0. This version indicates that the bdic |
94 // file contains a checksum. | 94 // file contains a checksum. |
95 static const char kDefaultVersionString[] = "-3-0"; | 95 static const char kDefaultVersionString[] = "-3-0"; |
96 | 96 |
97 // Add non-default version strings here. Use the same version for all the | 97 // Add non-default version strings here. Use the same version for all the |
98 // dictionaries that you add at the same time. Increment the major version | 98 // dictionaries that you add at the same time. Increment the major version |
99 // number if you're updating either dic or aff files. Increment the minor | 99 // number if you're updating either dic or aff files. Increment the minor |
100 // version number if you're updating only dic_delta files. | 100 // version number if you're updating only dic_delta files. |
101 static LanguageVersion special_version_string[] = { | 101 static LanguageVersion special_version_string[] = { |
102 {"et-EE", "-1-1"}, // No dic/aff files | 102 {"tr-TR", "-4-0"}, // Jan 9, 2013: Add "FLAG num" to aff to avoid heapcheck |
103 {"tr-TR", "-1-1"}, // No dic/aff files | 103 // crash. |
104 }; | 104 }; |
105 | 105 |
106 // Generate the bdict file name using default version string or special | 106 // Generate the bdict file name using default version string or special |
107 // version string, depending on the language. | 107 // version string, depending on the language. |
108 std::string language = GetSpellCheckLanguageRegion(input_language); | 108 std::string language = GetSpellCheckLanguageRegion(input_language); |
109 std::string versioned_bdict_file_name(language + kDefaultVersionString + | 109 std::string versioned_bdict_file_name(language + kDefaultVersionString + |
110 ".bdic"); | 110 ".bdic"); |
111 for (size_t i = 0; i < arraysize(special_version_string); ++i) { | 111 for (size_t i = 0; i < arraysize(special_version_string); ++i) { |
112 if (language == special_version_string[i].language) { | 112 if (language == special_version_string[i].language) { |
113 versioned_bdict_file_name = | 113 versioned_bdict_file_name = |
(...skipping 28 matching lines...) Expand all Loading... |
142 | 142 |
143 void SpellCheckLanguages(std::vector<std::string>* languages) { | 143 void SpellCheckLanguages(std::vector<std::string>* languages) { |
144 for (size_t i = 0; i < arraysize(g_supported_spellchecker_languages); | 144 for (size_t i = 0; i < arraysize(g_supported_spellchecker_languages); |
145 ++i) { | 145 ++i) { |
146 languages->push_back(g_supported_spellchecker_languages[i].language); | 146 languages->push_back(g_supported_spellchecker_languages[i].language); |
147 } | 147 } |
148 } | 148 } |
149 | 149 |
150 } // namespace spellcheck_common | 150 } // namespace spellcheck_common |
151 } // namespace chrome | 151 } // namespace chrome |
OLD | NEW |