From 122d6048355112c9b3c5858f03424416460675e1 Mon Sep 17 00:00:00 2001 From: stuebinm Date: Fri, 23 Jun 2023 01:56:43 +0200 Subject: [PATCH] mi la, toki pona li pona a --- src/components/post_status_form/post_status_form.js | 2 +- src/services/locale/locale.service.js | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/components/post_status_form/post_status_form.js b/src/components/post_status_form/post_status_form.js index 5647a9eb..25180ba9 100644 --- a/src/components/post_status_form/post_status_form.js +++ b/src/components/post_status_form/post_status_form.js @@ -303,7 +303,7 @@ const PostStatusForm = { mobileLayout: state => state.interface.mobileLayout }), isoLanguages () { - return iso6391.getAllCodes(); + return iso6391.getAllCodes().concat(['tok']); } }, watch: { diff --git a/src/services/locale/locale.service.js b/src/services/locale/locale.service.js index 8cef2522..8bee6ad2 100644 --- a/src/services/locale/locale.service.js +++ b/src/services/locale/locale.service.js @@ -5,7 +5,8 @@ import _ from 'lodash' const specialLanguageCodes = { 'ja_easy': 'ja', 'zh_Hant': 'zh-HANT', - 'zh': 'zh-Hans' + 'zh': 'zh-Hans', + 'tok': 'tok' } const internalToBrowserLocale = code => specialLanguageCodes[code] || code @@ -16,14 +17,15 @@ const getLanguageName = (code) => { const specialLanguageNames = { 'ja_easy': 'やさしいにほんご', 'zh': '简体中文', - 'zh_Hant': '繁體中文' + 'zh_Hant': '繁體中文', + 'tok': 'Toki Pona' } const languageName = specialLanguageNames[code] || ISO6391.getNativeName(code) const browserLocale = internalToBrowserLocale(code) return languageName.charAt(0).toLocaleUpperCase(browserLocale) + languageName.slice(1) } -const languages = _.map(languagesObject.languages, (code) => ({ code: code, name: getLanguageName(code) })).sort((a, b) => a.name.localeCompare(b.name)) +const languages = _.map(languagesObject.languages.concat(['tok']), (code) => ({ code: code, name: getLanguageName(code) })).sort((a, b) => a.name.localeCompare(b.name)) const localeService = { internalToBrowserLocale, -- 2.40.1