Merge pull request #5777 from darina/translit-useless-removed

Removed useless transliteration.
This commit is contained in:
Ilya Zverev 2017-04-06 13:21:18 +03:00 committed by GitHub
commit 6d179c79d3
2 changed files with 70 additions and 67 deletions

View file

@ -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.");

View file

@ -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())
{