diff options
author | surfdude29 <149612116+surfdude29@users.noreply.github.com> | 2025-03-05 23:56:13 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-03-05 15:56:13 -0800 |
commit | a42efd15d781f5bd7225589bbc0dd753aff44166 (patch) | |
tree | a99b72905f848df75db52e1b3514c5c9d6776a0b | |
parent | d0c2003cc77f8646e8aa9ae450c5accf889293ce (diff) | |
download | voidsky-a42efd15d781f5bd7225589bbc0dd753aff44166.tar.zst |
Add language: Scottish Gaelic (#7864)
* Create messages.po * Update app.config.js * Update lingui.config.js * Update dates.ts * Update helpers.ts * Update i18n.ts * Update i18n.web.ts * Update languages.ts
-rw-r--r-- | app.config.js | 1 | ||||
-rw-r--r-- | lingui.config.js | 1 | ||||
-rw-r--r-- | src/components/hooks/dates.ts | 2 | ||||
-rw-r--r-- | src/locale/helpers.ts | 2 | ||||
-rw-r--r-- | src/locale/i18n.ts | 9 | ||||
-rw-r--r-- | src/locale/i18n.web.ts | 4 | ||||
-rw-r--r-- | src/locale/languages.ts | 2 | ||||
-rw-r--r-- | src/locale/locales/gd/messages.po | 13 |
8 files changed, 34 insertions, 0 deletions
diff --git a/app.config.js b/app.config.js index 7288d84dc..c6f219e92 100644 --- a/app.config.js +++ b/app.config.js @@ -84,6 +84,7 @@ module.exports = function (config) { 'fi', 'fr', 'ga', + 'gd', 'gl', 'hi', 'hu', diff --git a/lingui.config.js b/lingui.config.js index 6738c4b35..38e194eb2 100644 --- a/lingui.config.js +++ b/lingui.config.js @@ -15,6 +15,7 @@ module.exports = { 'fi', 'fr', 'ga', + 'gd', 'gl', 'hi', 'hu', diff --git a/src/components/hooks/dates.ts b/src/components/hooks/dates.ts index 766e4997a..6b4b5f8fd 100644 --- a/src/components/hooks/dates.ts +++ b/src/components/hooks/dates.ts @@ -20,6 +20,7 @@ import { eu, fi, fr, + gd, gl, hi, hu, @@ -64,6 +65,7 @@ const locales: Record<AppLanguage, Locale | undefined> = { fi, fr, ga: undefined, + gd, gl, hi, hu, diff --git a/src/locale/helpers.ts b/src/locale/helpers.ts index 0d1017b40..e570224b1 100644 --- a/src/locale/helpers.ts +++ b/src/locale/helpers.ts @@ -181,6 +181,8 @@ export function sanitizeAppLanguageSetting(appLanguage: string): AppLanguage { return AppLanguage.fr case 'ga': return AppLanguage.ga + case 'gd': + return AppLanguage.gd case 'gl': return AppLanguage.gl case 'hi': diff --git a/src/locale/i18n.ts b/src/locale/i18n.ts index 2a12bcfaa..312904c22 100644 --- a/src/locale/i18n.ts +++ b/src/locale/i18n.ts @@ -25,6 +25,7 @@ import {messages as messagesEu} from '#/locale/locales/eu/messages' import {messages as messagesFi} from '#/locale/locales/fi/messages' import {messages as messagesFr} from '#/locale/locales/fr/messages' import {messages as messagesGa} from '#/locale/locales/ga/messages' +import {messages as messagesGd} from '#/locale/locales/gd/messages' import {messages as messagesGl} from '#/locale/locales/gl/messages' import {messages as messagesHi} from '#/locale/locales/hi/messages' import {messages as messagesHu} from '#/locale/locales/hu/messages' @@ -159,6 +160,14 @@ export async function dynamicActivate(locale: AppLanguage) { ]) break } + case AppLanguage.gd: { + i18n.loadAndActivate({locale, messages: messagesGd}) + await Promise.all([ + import('@formatjs/intl-pluralrules/locale-data/gd'), + import('@formatjs/intl-numberformat/locale-data/gd'), + ]) + break + } case AppLanguage.gl: { i18n.loadAndActivate({locale, messages: messagesGl}) await Promise.all([ diff --git a/src/locale/i18n.web.ts b/src/locale/i18n.web.ts index 3600d0533..25458ed38 100644 --- a/src/locale/i18n.web.ts +++ b/src/locale/i18n.web.ts @@ -64,6 +64,10 @@ export async function dynamicActivate(locale: AppLanguage) { mod = await import(`./locales/ga/messages`) break } + case AppLanguage.gd: { + mod = await import(`./locales/gd/messages`) + break + } case AppLanguage.gl: { mod = await import(`./locales/gl/messages`) break diff --git a/src/locale/languages.ts b/src/locale/languages.ts index 2ba34bf37..43f1626b6 100644 --- a/src/locale/languages.ts +++ b/src/locale/languages.ts @@ -19,6 +19,7 @@ export enum AppLanguage { fi = 'fi', fr = 'fr', ga = 'ga', + gd = 'gd', gl = 'gl', hi = 'hi', hu = 'hu', @@ -64,6 +65,7 @@ export const APP_LANGUAGES: AppLanguageConfig[] = [ {code2: AppLanguage.fi, name: 'Suomi – Finnish'}, {code2: AppLanguage.fr, name: 'Français – French'}, {code2: AppLanguage.ga, name: 'Gaeilge – Irish'}, + {code2: AppLanguage.gd, name: 'Gàidhlig – Scottish Gaelic'}, {code2: AppLanguage.gl, name: 'Galego – Galician'}, {code2: AppLanguage.hi, name: 'हिंदी – Hindi'}, {code2: AppLanguage.hu, name: 'magyar – Hungarian'}, diff --git a/src/locale/locales/gd/messages.po b/src/locale/locales/gd/messages.po new file mode 100644 index 000000000..a018e77bb --- /dev/null +++ b/src/locale/locales/gd/messages.po @@ -0,0 +1,13 @@ +msgid "" +msgstr "" +"POT-Creation-Date: 2023-11-05 16:01-0800\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: @lingui/cli\n" +"Language: gd\n" +"Project-Id-Version: bluesky-social\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: \n" +"Last-Translator: \n" +"Language-Team: Scottish Gaelic\n" |