Merge branch 'atiksoftware-main' into main

zio/stable
Paul Frazee 2024-04-03 17:15:33 -07:00
commit 9d5c82d9a8
6 changed files with 4417 additions and 11 deletions

View File

@ -16,6 +16,7 @@ module.exports = {
'zh-CN', 'zh-CN',
'zh-TW', 'zh-TW',
'it', 'it',
'tr',
], ],
catalogs: [ catalogs: [
{ {

View File

@ -1,7 +1,8 @@
import {AppBskyFeedDefs, AppBskyFeedPost} from '@atproto/api' import {AppBskyFeedDefs, AppBskyFeedPost} from '@atproto/api'
import lande from 'lande'
import {hasProp} from 'lib/type-guards'
import * as bcp47Match from 'bcp-47-match' import * as bcp47Match from 'bcp-47-match'
import lande from 'lande'
import {hasProp} from 'lib/type-guards'
import { import {
AppLanguage, AppLanguage,
LANGUAGES_MAP_CODE2, LANGUAGES_MAP_CODE2,
@ -146,6 +147,8 @@ export function sanitizeAppLanguageSetting(appLanguage: string): AppLanguage {
return AppLanguage.zh_TW return AppLanguage.zh_TW
case 'it': case 'it':
return AppLanguage.it return AppLanguage.it
case 'tr':
return AppLanguage.tr
default: default:
continue continue
} }

View File

@ -1,25 +1,25 @@
import {useEffect} from 'react' import {useEffect} from 'react'
import {i18n} from '@lingui/core' import {i18n} from '@lingui/core'
import {useLanguagePrefs} from '#/state/preferences' import {sanitizeAppLanguageSetting} from '#/locale/helpers'
import {messages as messagesEn} from '#/locale/locales/en/messages' import {AppLanguage} from '#/locale/languages'
import {messages as messagesCa} from '#/locale/locales/ca/messages'
import {messages as messagesDe} from '#/locale/locales/de/messages' import {messages as messagesDe} from '#/locale/locales/de/messages'
import {messages as messagesId} from '#/locale/locales/id/messages' import {messages as messagesEn} from '#/locale/locales/en/messages'
import {messages as messagesEs} from '#/locale/locales/es/messages' import {messages as messagesEs} from '#/locale/locales/es/messages'
import {messages as messagesFi} from '#/locale/locales/fi/messages' import {messages as messagesFi} from '#/locale/locales/fi/messages'
import {messages as messagesFr} from '#/locale/locales/fr/messages' import {messages as messagesFr} from '#/locale/locales/fr/messages'
import {messages as messagesHi} from '#/locale/locales/hi/messages' import {messages as messagesHi} from '#/locale/locales/hi/messages'
import {messages as messagesId} from '#/locale/locales/id/messages'
import {messages as messagesIt} from '#/locale/locales/it/messages'
import {messages as messagesJa} from '#/locale/locales/ja/messages' import {messages as messagesJa} from '#/locale/locales/ja/messages'
import {messages as messagesKo} from '#/locale/locales/ko/messages' import {messages as messagesKo} from '#/locale/locales/ko/messages'
import {messages as messagesPt_BR} from '#/locale/locales/pt-BR/messages' import {messages as messagesPt_BR} from '#/locale/locales/pt-BR/messages'
import {messages as messagesTr} from '#/locale/locales/tr/messages'
import {messages as messagesUk} from '#/locale/locales/uk/messages' import {messages as messagesUk} from '#/locale/locales/uk/messages'
import {messages as messagesCa} from '#/locale/locales/ca/messages'
import {messages as messagesZh_CN} from '#/locale/locales/zh-CN/messages' import {messages as messagesZh_CN} from '#/locale/locales/zh-CN/messages'
import {messages as messagesZh_TW} from '#/locale/locales/zh-TW/messages' import {messages as messagesZh_TW} from '#/locale/locales/zh-TW/messages'
import {messages as messagesIt} from '#/locale/locales/it/messages' import {useLanguagePrefs} from '#/state/preferences'
import {sanitizeAppLanguageSetting} from '#/locale/helpers'
import {AppLanguage} from '#/locale/languages'
/** /**
* We do a dynamic import of just the catalog that we need * We do a dynamic import of just the catalog that we need
@ -80,6 +80,11 @@ export async function dynamicActivate(locale: AppLanguage) {
} }
case AppLanguage.zh_TW: { case AppLanguage.zh_TW: {
i18n.loadAndActivate({locale, messages: messagesZh_TW}) i18n.loadAndActivate({locale, messages: messagesZh_TW})
break
}
case AppLanguage.tr: {
i18n.loadAndActivate({locale, messages: messagesTr})
break
} }
default: { default: {
i18n.loadAndActivate({locale, messages: messagesEn}) i18n.loadAndActivate({locale, messages: messagesEn})

View File

@ -1,9 +1,9 @@
import {useEffect} from 'react' import {useEffect} from 'react'
import {i18n} from '@lingui/core' import {i18n} from '@lingui/core'
import {useLanguagePrefs} from '#/state/preferences'
import {sanitizeAppLanguageSetting} from '#/locale/helpers' import {sanitizeAppLanguageSetting} from '#/locale/helpers'
import {AppLanguage} from '#/locale/languages' import {AppLanguage} from '#/locale/languages'
import {useLanguagePrefs} from '#/state/preferences'
/** /**
* We do a dynamic import of just the catalog that we need * We do a dynamic import of just the catalog that we need
@ -68,6 +68,10 @@ export async function dynamicActivate(locale: AppLanguage) {
mod = await import(`./locales/it/messages`) mod = await import(`./locales/it/messages`)
break break
} }
case AppLanguage.tr: {
mod = await import(`./locales/tr/messages`)
break
}
default: { default: {
mod = await import(`./locales/en/messages`) mod = await import(`./locales/en/messages`)
break break

View File

@ -20,6 +20,7 @@ export enum AppLanguage {
zh_CN = 'zh-CN', zh_CN = 'zh-CN',
zh_TW = 'zh-TW', zh_TW = 'zh-TW',
it = 'it', it = 'it',
tr = 'tr',
} }
interface AppLanguageConfig { interface AppLanguageConfig {
@ -43,6 +44,7 @@ export const APP_LANGUAGES: AppLanguageConfig[] = [
{code2: AppLanguage.zh_CN, name: '简体中文(中国) Chinese (Simplified)'}, {code2: AppLanguage.zh_CN, name: '简体中文(中国) Chinese (Simplified)'},
{code2: AppLanguage.zh_TW, name: '繁體中文(臺灣) Chinese (Traditional)'}, {code2: AppLanguage.zh_TW, name: '繁體中文(臺灣) Chinese (Traditional)'},
{code2: AppLanguage.it, name: 'Italiano - Italian'}, {code2: AppLanguage.it, name: 'Italiano - Italian'},
{code2: AppLanguage.tr, name: 'Türkçe - Turkish'},
] ]
export const LANGUAGES: Language[] = [ export const LANGUAGES: Language[] = [

File diff suppressed because it is too large Load Diff