Japanese localization (#2003)

* add japanese to list of languages

* add japanese translations

* change `jp` to `ja`

* minor changes to Japanese translation

* minor changes to Japanese translation

* update japanese strings with feedback

* Update languages.ts

* Extract translations

* Gitignore new compiled file

* allow switching to japanese

---------

Co-authored-by: Jake Gold <jake@blueskyweb.xyz>
Co-authored-by: Eric Bailey <git@esb.lol>
zio/stable
Ansh 2023-12-13 01:12:19 +05:30 committed by GitHub
parent 27561ae79f
commit 90647fe7cf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 2430 additions and 15 deletions

View File

@ -1,6 +1,6 @@
/** @type {import('@lingui/conf').LinguiConfig} */
module.exports = {
locales: ['en', 'hi'],
locales: ['en', 'hi', 'ja'],
catalogs: [
{
path: '<rootDir>/src/locale/locales/{locale}/messages',

View File

@ -112,6 +112,8 @@ export function sanitizeAppLanguageSetting(appLanguage: string): AppLanguage {
return AppLanguage.en
case 'hi':
return AppLanguage.hi
case 'ja':
return AppLanguage.ja
default:
continue
}

View File

@ -4,6 +4,7 @@ import {i18n} from '@lingui/core'
import {useLanguagePrefs} from '#/state/preferences'
import {messages as messagesEn} from '#/locale/locales/en/messages'
import {messages as messagesHi} from '#/locale/locales/hi/messages'
import {messages as messagesJa} from '#/locale/locales/ja/messages'
import {sanitizeAppLanguageSetting} from '#/locale/helpers'
import {AppLanguage} from '#/locale/languages'
@ -16,6 +17,10 @@ export async function dynamicActivate(locale: AppLanguage) {
i18n.loadAndActivate({locale, messages: messagesHi})
break
}
case AppLanguage.ja: {
i18n.loadAndActivate({locale, messages: messagesJa})
break
}
default: {
i18n.loadAndActivate({locale, messages: messagesEn})
break

View File

@ -16,6 +16,10 @@ export async function dynamicActivate(locale: AppLanguage) {
mod = await import(`./locales/hi/messages`)
break
}
case AppLanguage.ja: {
mod = await import(`./locales/ja/messages`)
break
}
default: {
mod = await import(`./locales/en/messages`)
break

View File

@ -7,6 +7,7 @@ interface Language {
export enum AppLanguage {
en = 'en',
hi = 'hi',
ja = 'ja',
}
interface AppLanguageConfig {
@ -17,6 +18,7 @@ interface AppLanguageConfig {
export const APP_LANGUAGES: AppLanguageConfig[] = [
{code2: AppLanguage.en, name: 'English'},
{code2: AppLanguage.hi, name: 'हिंदी'},
{code2: AppLanguage.ja, name: '日本語'},
]
export const LANGUAGES: Language[] = [

View File

@ -188,7 +188,7 @@ msgstr ""
msgid "and"
msgstr ""
#: src/view/screens/LanguageSettings.tsx:94
#: src/view/screens/LanguageSettings.tsx:95
msgid "App Language"
msgstr ""
@ -547,7 +547,7 @@ msgid "Content Filtering"
msgstr ""
#: src/view/com/modals/lang-settings/ContentLanguagesSettings.tsx:74
#: src/view/screens/LanguageSettings.tsx:277
#: src/view/screens/LanguageSettings.tsx:278
msgid "Content Languages"
msgstr ""
@ -1099,7 +1099,7 @@ msgstr ""
msgid "Language selection"
msgstr ""
#: src/view/screens/LanguageSettings.tsx:88
#: src/view/screens/LanguageSettings.tsx:89
msgid "Language Settings"
msgstr ""
@ -1603,7 +1603,7 @@ msgstr ""
msgid "Previous image"
msgstr ""
#: src/view/screens/LanguageSettings.tsx:186
#: src/view/screens/LanguageSettings.tsx:187
msgid "Primary Language"
msgstr ""
@ -1886,15 +1886,15 @@ msgstr ""
msgid "Select service"
msgstr ""
#: src/view/screens/LanguageSettings.tsx:280
#: src/view/screens/LanguageSettings.tsx:281
msgid "Select which languages you want your subscribed feeds to include. If none are selected, all languages will be shown."
msgstr ""
#: src/view/screens/LanguageSettings.tsx:97
#: src/view/screens/LanguageSettings.tsx:98
msgid "Select your app language for the default text to display in the app"
msgstr ""
#: src/view/screens/LanguageSettings.tsx:189
#: src/view/screens/LanguageSettings.tsx:190
msgid "Select your preferred language for translations in your feed."
msgstr ""

View File

@ -188,7 +188,7 @@ msgstr "{0} को ईमेल भेजा गया है। इसमें
msgid "and"
msgstr "और"
#: src/view/screens/LanguageSettings.tsx:94
#: src/view/screens/LanguageSettings.tsx:95
msgid "App Language"
msgstr "ऐप भाषा"
@ -543,7 +543,7 @@ msgid "Content Filtering"
msgstr "सामग्री फ़िल्टरिंग"
#: src/view/com/modals/lang-settings/ContentLanguagesSettings.tsx:74
#: src/view/screens/LanguageSettings.tsx:277
#: src/view/screens/LanguageSettings.tsx:278
msgid "Content Languages"
msgstr "सामग्री भाषा"
@ -1091,7 +1091,7 @@ msgstr "वेटरलिस्ट में शामिल हों"
msgid "Language selection"
msgstr "अपनी भाषा चुने"
#: src/view/screens/LanguageSettings.tsx:88
#: src/view/screens/LanguageSettings.tsx:89
msgid "Language Settings"
msgstr "भाषा सेटिंग्स"
@ -1595,7 +1595,7 @@ msgstr "शायद एक भ्रामक लिंक"
msgid "Previous image"
msgstr "पिछली छवि"
#: src/view/screens/LanguageSettings.tsx:186
#: src/view/screens/LanguageSettings.tsx:187
msgid "Primary Language"
msgstr "प्राथमिक भाषा"
@ -1878,15 +1878,15 @@ msgstr "मौजूदा खाते से चुनें"
msgid "Select service"
msgstr "सेवा चुनें"
#: src/view/screens/LanguageSettings.tsx:280
#: src/view/screens/LanguageSettings.tsx:281
msgid "Select which languages you want your subscribed feeds to include. If none are selected, all languages will be shown."
msgstr "चुनें कि आप अपनी सदस्यता वाली फ़ीड में कौन सी भाषाएँ शामिल करना चाहते हैं। यदि कोई भी चयनित नहीं है, तो सभी भाषाएँ दिखाई जाएंगी।"
#: src/view/screens/LanguageSettings.tsx:97
#: src/view/screens/LanguageSettings.tsx:98
msgid "Select your app language for the default text to display in the app"
msgstr "ऐप में प्रदर्शित होने वाले डिफ़ॉल्ट टेक्स्ट के लिए अपनी ऐप भाषा चुनें"
#: src/view/screens/LanguageSettings.tsx:189
#: src/view/screens/LanguageSettings.tsx:190
msgid "Select your preferred language for translations in your feed."
msgstr "अपने फ़ीड में अनुवाद के लिए अपनी पसंदीदा भाषा चुनें।"

File diff suppressed because it is too large Load Diff