Closed IceHe closed 2 years ago
* Logto Localization supported which [languages tags](https://en.wikipedia.org/wiki/IETF_language_tag) and their native names. * Follow Facebook supported languages (see [Select language - Facebook (mobile)](https://m.facebook.com/language/)) (aligned with @noodles) * Merge with existing built-in languages (`en`, `fr`, `ko-KR`, `pt-PT`, `tr-TR`, `zh-CN`) * Add `zh-MO` (per eng weekly discussion) * Define in a new package `@logto/language-kit` in repo `logto-io/toolkit` . [image.png](https://uploads.linear.app/65ddb27d-1d2f-481b-a190-1a5d402b169e/e7633189-5636-4dc5-b578-6c55d4468cf4/c72c15e7-2cad-48de-a1e3-d49d463898c5) \--- Logto Localization supported language tags and native names: ``` { 'af-ZA': 'Afrikaans', 'am-ET': 'አማርኛ', 'ar-AR': 'العربية', 'as-IN': 'অসমীয়া', 'az-AZ': 'Azərbaycan dili', 'be-BY': 'Беларуская', 'bg-BG': 'Български', 'bn-IN': 'বাংলা', 'br-FR': 'Brezhoneg', 'bs-BA': 'Bosanski', 'ca-ES': 'Català', 'cb-IQ': 'کوردیی ناوەندی', 'co-FR': 'Corsu', 'cs-CZ': 'Čeština', 'cx-PH': 'Bisaya', 'cy-GB': 'Cymraeg', 'da-DK': 'Dansk', 'de-DE': 'Deutsch', 'el-GR': 'Ελληνικά', en: 'English', 'en-GB': 'English (UK)', 'en-US': 'English (US)', 'eo-EO': 'Esperanto', 'es-ES': 'Español (España)', 'es-LA': 'Español', 'et-EE': 'Eesti', 'eu-ES': 'Euskara', 'fa-IR': 'فارسی', 'ff-NG': 'Fula', 'fi-FI': 'Suomi', 'fo-FO': 'Føroyskt', fr: 'Français', 'fr-CA': 'Français (Canada)', 'fr-FR': 'Français (France)', 'fy-NL': 'Frysk', 'ga-IE': 'Gaeilge', 'gl-ES': 'Galego', 'gn-PY': 'Guarani', 'gu-IN': 'ગુજરાતી', 'ha-NG': 'Hausa', 'he-IL': 'עברית', 'hi-IN': 'हिन्दी', 'hr-HR': 'Hrvatski', 'ht-HT': 'Kreyòl Ayisyen', 'hu-HU': 'Magyar', 'hy-AM': 'Հայերեն', 'id-ID': 'Bahasa Indonesia', 'ik-US': 'Iñupiatun', 'is-IS': 'Íslenska', 'it-IT': 'Italiano', 'iu-CA': 'Inuktitut', 'ja-JP': '日本語', 'ja-KS': '日本語(関西)', 'jv-ID': 'Basa Jawa', 'ka-GE': 'ქართული', 'kk-KZ': 'Қазақша', 'km-KH': 'ភាសាខ្មែរ', 'kn-IN': 'ಕನ್ನಡ', 'ko-KR': '한국어', 'ku-TR': 'Kurdî (Kurmancî)', 'ky-KG': 'кыргызча', 'lo-LA': 'ພາສາລາວ', 'lt-LT': 'Lietuvių', 'lv-LV': 'Latviešu', 'mg-MG': 'Malagasy', 'mk-MK': 'Македонски', 'ml-IN': 'മലയാളം', 'mn-MN': 'Монгол', 'mr-IN': 'मराठी', 'ms-MY': 'Bahasa Melayu', 'mt-MT': 'Malti', 'my-MM': 'မြန်မာဘာသာ', 'nb-NO': 'Norsk (bokmål)', 'ne-NP': 'नेपाली', 'nl-BE': 'Vlaams', 'nl-NL': 'Nederlands', 'nn-NO': 'Norsk (nynorsk)', 'or-IN': 'ଓଡ଼ିଆ', 'pa-IN': 'ਪੰਜਾਬੀ', 'pl-PL': 'Polski', 'ps-AF': 'پښتو', 'pt-BR': 'Português (Brasil)', 'pt-PT': 'Português', 'ro-RO': 'Română', 'ru-RU': 'Русский', 'rw-RW': 'Ikinyarwanda', 'sc-IT': 'Sardu', 'si-LK': 'සිංහල', 'sk-SK': 'Slovenčina', 'sl-SI': 'Slovenščina', 'sn-ZW': 'Shona', 'sq-AL': 'Shqip', 'sr-RS': 'Српски', 'sv-SE': 'Svenska', 'sw-KE': 'Kiswahili', 'sy-SY': 'ܣܘܪܝܝܐ', 'sz-PL': 'ślōnskŏ gŏdka', 'ta-IN': 'தமிழ்', 'te-IN': 'తెలుగు', 'tg-TJ': 'Тоҷикӣ', 'th-TH': 'ภาษาไทย', 'tl-PH': 'Filipino', 'tr-TR': 'Türkçe', 'tt-RU': 'Татарча', 'tz-MA': 'ⵜⴰⵎⴰⵣⵉⵖⵜ', 'uk-UA': 'Українська', 'ur-PK': 'اردو', 'uz-UZ': "O'zbek", 'vi-VN': 'Tiếng Việt', 'zh-CN': '简体中文', 'zh-HK': '繁體中文(香港)', 'zh-MO': '繁體中文(澳門)', 'zh-TW': '繁體中文(台灣)', 'zz-TR': 'Zaza', } ``` \--- Reference: Related Slack discussions: [thread1](https://silverhand-io.slack.com/archives/C02A8G4HVAM/p1661829323619059), [thread2](https://silverhand-io.slack.com/archives/C0243P3E4KS/p1662546268519339), [thread3](https://silverhand-io.slack.com/archives/C0243P3E4KS/p1663644517624279), [thread4](https://silverhand-io.slack.com/archives/C02A8G4HVAM/p1663817921497889), [thread5](https://silverhand-io.slack.com/archives/C02A8G4HVAM/p1663829223949999)
master
Total Size Diff :chart_with_upwards_trend: +7.05 KB
Updated: Since Localization feature is not ready to merge into logto master branch, we keep old language related type, constants, utility function for master branch compatibility for now. (They will be removed after merging Localization feature into master branch.)
Summary
@logto/language-kit
packagelanguages
: contains language tag to native name pairsLanguageTag
isLanguageTag
languageTagGuard
core-kit
andconnector-kit
importlanguage-kit
core-kit
removeLanguageKey
,languageKeys
andlanguageKeyGuard
Testing
Locally tested.
UTs