summaryrefslogtreecommitdiff
path: root/pkgs/patches/akkoma-fe-toki-pona.patch
blob: 281fdfcecb2974257648801092a071933760bc6e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
From 122d6048355112c9b3c5858f03424416460675e1 Mon Sep 17 00:00:00 2001
From: stuebinm <stuebinm@disroot.org>
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