diff options
author | Daria Volvenkova <d.volvenkova@corp.mail.ru> | 2017-04-05 20:58:40 +0300 |
---|---|---|
committer | Daria Volvenkova <d.volvenkova@corp.mail.ru> | 2017-04-06 13:14:42 +0300 |
commit | 06ee2f8d547db45cde1de46c53d6a1215b9857a2 (patch) | |
tree | 2ce7b4c4bb7d569923d362e3a5fb2ffeb528b693 | |
parent | 3e781178d61eedf04191c07f2a9545a3f03fb0eb (diff) |
Removed useless transliteration.
-rw-r--r-- | coding/multilang_utf8_string.cpp | 131 | ||||
-rw-r--r-- | coding/transliteration.cpp | 6 |
2 files changed, 70 insertions, 67 deletions
diff --git a/coding/multilang_utf8_string.cpp b/coding/multilang_utf8_string.cpp index 9e3211501a..0a2fce644b 100644 --- a/coding/multilang_utf8_string.cpp +++ b/coding/multilang_utf8_string.cpp @@ -9,72 +9,71 @@ namespace // Languages below were choosen after sorting name:<lang> tags in 2011. // Note, that it's not feasible to increase languages number here due to // our current encoding (6 bit to store language code). -StringUtf8Multilang::Languages const g_languages = {{ - {"default", "Native for each country", "Any-Latin"}, - {"en", "English", ""}, - {"ja", "日本語", ""}, - {"fr", "Français", ""}, - {"ko_rm", "Korean (Romanized)", "Korean-Latin/BGN"}, - {"ar", "العربية", "Any-Latin"}, - {"de", "Deutsch", ""}, - {"int_name", "International (Latin)", "Any-Latin"}, - {"ru", "Русский", "Russian-Latin/BGN"}, - {"sv", "Svenska", "Any-Latin"}, - {"zh", "中文", "Any-Latin"}, - {"fi", "Suomi", "Any-Latin"}, - {"be", "Беларуская", "Belarusian-Latin/BGN"}, - {"ka", "ქართული", "Georgian-Latin"}, - {"ko", "한국어", "Hangul-Latin/BGN"}, - {"he", "עברית", "Hebrew-Latin/BGN"}, - {"nl", "Nederlands", ""}, - {"ga", "Gaeilge", "Any-Latin"}, - {"ja_rm", "Japanese (Romanized)", "Any-Latin"}, - {"el", "Ελληνικά", "Greek-Latin"}, - {"it", "Italiano", ""}, - {"es", "Español", ""}, - {"zh_pinyin", "Chinese (Pinyin)", "Any-Latin"}, - {"th", "ไทย", "Thai-Latin"}, - {"cy", "Cymraeg", "Any-Latin"}, - {"sr", "Српски", "Serbian-Latin/BGN"}, - {"uk", "Українська", "Ukrainian-Latin/BGN"}, - {"ca", "Català", "Any-Latin"}, - {"hu", "Magyar", "Any-Latin"}, - {"hsb", "Hornjoserbšćina", "Any-Latin"}, - {"eu", "Euskara", "Any-Latin"}, - {"fa", "فارسی", "Any-Latin"}, - {"br", "Breton", "Any-Latin"}, - {"pl", "Polski", "Any-Latin"}, - {"hy", "Հայերէն", "Armenian-Latin"}, - {"kn", "ಕನ್ನಡ", "Kannada-Latin"}, - {"sl", "Slovenščina", "Any-Latin"}, - {"ro", "Română", "Any-Latin"}, - {"sq", "Shqipe", "Any-Latin"}, - {"am", "አማርኛ", "Amharic-Latin/BGN"}, - {"fy", "Frysk", "Any-Latin"}, - {"cs", "Čeština", "Any-Latin"}, - {"gd", "Gàidhlig", "Any-Latin"}, - {"sk", "Slovenčina", "Any-Latin"}, - {"af", "Afrikaans", "Any-Latin"}, - {"ja_kana", "日本語(カタカナ)", "Katakana-Latin"}, - {"lb", "Luxembourgish", "Any-Latin"}, - {"pt", "Português", "Any-Latin"}, - {"hr", "Hrvatski", "Any-Latin"}, - {"fur", "Friulian", "Any-Latin"}, - {"vi", "Tiếng Việt", "Any-Latin"}, - {"tr", "Türkçe", "Any-Latin"}, - {"bg", "Български", "Bulgarian-Latin/BGN"}, - {"eo", "Esperanto", "Any-Latin"}, - {"lt", "Lietuvių", "Any-Latin"}, - {"la", "Latin", ""}, - {"kk", "Қазақ", "Kazakh-Latin/BGN"}, - {"gsw", "Schwiizertüütsch", "Any-Latin"}, - {"et", "Eesti", "Any-Latin"}, - {"ku", "Kurdish", "Any-Latin"}, - {"mn", "Mongolian", "Mongolian-Latin/BGN"}, - {"mk", "Македонски", "Macedonian-Latin/BGN"}, - {"lv", "Latviešu", "Any-Latin"}, - {"hi", "हिन्दी", "Any-Latin"} -}}; +StringUtf8Multilang::Languages const g_languages = { + {{"default", "Native for each country", "Any-Latin"}, + {"en", "English", ""}, + {"ja", "日本語", ""}, + {"fr", "Français", ""}, + {"ko_rm", "Korean (Romanized)", "Korean-Latin/BGN"}, + {"ar", "العربية", "Any-Latin"}, + {"de", "Deutsch", ""}, + {"int_name", "International (Latin)", "Any-Latin"}, + {"ru", "Русский", "Russian-Latin/BGN"}, + {"sv", "Svenska", ""}, + {"zh", "中文", "Any-Latin"}, + {"fi", "Suomi", ""}, + {"be", "Беларуская", "Belarusian-Latin/BGN"}, + {"ka", "ქართული", "Georgian-Latin"}, + {"ko", "한국어", "Hangul-Latin/BGN"}, + {"he", "עברית", "Hebrew-Latin/BGN"}, + {"nl", "Nederlands", ""}, + {"ga", "Gaeilge", ""}, + {"ja_rm", "Japanese (Romanized)", "Any-Latin"}, + {"el", "Ελληνικά", "Greek-Latin"}, + {"it", "Italiano", ""}, + {"es", "Español", ""}, + {"zh_pinyin", "Chinese (Pinyin)", "Any-Latin"}, + {"th", "ไทย", "Thai-Latin"}, + {"cy", "Cymraeg", ""}, + {"sr", "Српски", "Serbian-Latin/BGN"}, + {"uk", "Українська", "Ukrainian-Latin/BGN"}, + {"ca", "Català", ""}, + {"hu", "Magyar", ""}, + {"hsb", "Hornjoserbšćina", ""}, + {"eu", "Euskara", ""}, + {"fa", "فارسی", "Any-Latin"}, + {"br", "Breton", ""}, + {"pl", "Polski", ""}, + {"hy", "Հայերէն", "Armenian-Latin"}, + {"kn", "ಕನ್ನಡ", "Kannada-Latin"}, + {"sl", "Slovenščina", ""}, + {"ro", "Română", ""}, + {"sq", "Shqipe", ""}, + {"am", "አማርኛ", "Amharic-Latin/BGN"}, + {"fy", "Frysk", ""}, + {"cs", "Čeština", ""}, + {"gd", "Gàidhlig", ""}, + {"sk", "Slovenčina", ""}, + {"af", "Afrikaans", ""}, + {"ja_kana", "日本語(カタカナ)", "Katakana-Latin"}, + {"lb", "Luxembourgish", ""}, + {"pt", "Português", ""}, + {"hr", "Hrvatski", ""}, + {"fur", "Friulian", ""}, + {"vi", "Tiếng Việt", ""}, + {"tr", "Türkçe", ""}, + {"bg", "Български", "Bulgarian-Latin/BGN"}, + {"eo", "Esperanto", ""}, + {"lt", "Lietuvių", ""}, + {"la", "Latin", ""}, + {"kk", "Қазақ", "Kazakh-Latin/BGN"}, + {"gsw", "Schwiizertüütsch", ""}, + {"et", "Eesti", ""}, + {"ku", "Kurdish", "Any-Latin"}, + {"mn", "Mongolian", "Mongolian-Latin/BGN"}, + {"mk", "Македонски", "Macedonian-Latin/BGN"}, + {"lv", "Latviešu", ""}, + {"hi", "हिन्दी", "Any-Latin"}}}; static_assert(g_languages.size() == StringUtf8Multilang::kMaxSupportedLanguages, "With current encoding we are limited to 64 languages max."); diff --git a/coding/transliteration.cpp b/coding/transliteration.cpp index e09d8b25c6..ca2f84e643 100644 --- a/coding/transliteration.cpp +++ b/coding/transliteration.cpp @@ -53,7 +53,11 @@ bool Transliteration::Transliterate(std::string const & str, int8_t langCode, st if (str.empty()) return false; - auto const transliteratorId = StringUtf8Multilang::GetTransliteratorIdByCode(langCode); + std::string const transliteratorId(StringUtf8Multilang::GetTransliteratorIdByCode(langCode)); + + if (transliteratorId.empty()) + return false; + auto const & it = m_transliterators.find(transliteratorId); if (it == m_transliterators.end()) { |