diff options
Diffstat (limited to 'chrome/common/spellcheck_common.cc')
-rw-r--r-- | chrome/common/spellcheck_common.cc | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/chrome/common/spellcheck_common.cc b/chrome/common/spellcheck_common.cc index 26d90ce..21ff923 100644 --- a/chrome/common/spellcheck_common.cc +++ b/chrome/common/spellcheck_common.cc @@ -169,4 +169,17 @@ void SpellCheckLanguages(std::vector<std::string>* languages) { } } + +std::string GetLanguageFromLanguageRegion(std::string input_language) { + for (size_t i = 0; i < ARRAYSIZE_UNSAFE(g_supported_spellchecker_languages); + ++i) { + std::string language( + g_supported_spellchecker_languages[i].language_region); + if (language == input_language) + return std::string(g_supported_spellchecker_languages[i].language); + } + + return input_language; +} + } // namespace SpellCheckCommon |