diff options
Diffstat (limited to 'coding')
-rw-r--r-- | coding/multilang_utf8_string.cpp | 49 | ||||
-rw-r--r-- | coding/transliteration.cpp | 8 |
2 files changed, 39 insertions, 18 deletions
diff --git a/coding/multilang_utf8_string.cpp b/coding/multilang_utf8_string.cpp index a3e1723121..107655bca9 100644 --- a/coding/multilang_utf8_string.cpp +++ b/coding/multilang_utf8_string.cpp @@ -9,23 +9,38 @@ 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", "日本語", "Any-Latin"}, {"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"}, {"he", "עברית", "Hebrew"}, {"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", "日本語", "Any-Latin"}, {"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"} + }}; 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 937dd8106f..c1a9ab1138 100644 --- a/coding/transliteration.cpp +++ b/coding/transliteration.cpp @@ -3,6 +3,7 @@ #include "base/logging.hpp" +#include "3party/icu/common/unicode/uclean.h" #include "3party/icu/common/unicode/unistr.h" #include "3party/icu/common/unicode/utypes.h" #include "3party/icu/i18n/unicode/translit.h" @@ -10,7 +11,12 @@ Transliteration::~Transliteration() { - //u_cleanup(); + // The use of u_cleanup() just before an application terminates is optional, + // but it should be called only once for performance reasons. + // The primary benefit is to eliminate reports of memory or resource leaks originating + // in ICU code from the results generated by heap analysis tools. + m_transliterators.clear(); + u_cleanup(); } Transliteration & Transliteration::GetInstance() |