Add Portuguese Localization (#2407)

* Create messages.

* Update helpers.test.ts

* Update helpers.ts

* Update i18n.ts

* Update i18n.web.ts

* Update languages.ts

* Update i18n.ts

* Update lingui.config.js

* Correct file name and remove unused variables!

* Update Language-Team

* Update Bump ios build

* Fix for Stop the user from posting before the link card finishes loading #2328

* Update based in model en

* Update last version lang

* Update messages.po tsx:160 and tsx:143

* Bump ios build number and android version code

* adjustment

* adjustment 100%

* Update Date

* Update Day for Merge

* Update Name Maison for Maison da Silva

* fix order of case

* fix lint

* add tag for BR portugese

* add tag for BR

* update `pt` to `pt-BR`

---------

Co-authored-by: Maison da Silva <maisonmdsgreen@hotmail.com>
zio/stable
Ansh 2024-01-04 00:15:56 +05:30 committed by GitHub
parent 7299c730cf
commit 1fed517a17
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 2687 additions and 1 deletions

View File

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

View File

@ -5,6 +5,7 @@ import {AppLanguage} from '#/locale/languages'
test('sanitizeAppLanguageSetting', () => { test('sanitizeAppLanguageSetting', () => {
expect(sanitizeAppLanguageSetting('en')).toBe(AppLanguage.en) expect(sanitizeAppLanguageSetting('en')).toBe(AppLanguage.en)
expect(sanitizeAppLanguageSetting('pt-BR')).toBe(AppLanguage.pt_BR)
expect(sanitizeAppLanguageSetting('hi')).toBe(AppLanguage.hi) expect(sanitizeAppLanguageSetting('hi')).toBe(AppLanguage.hi)
expect(sanitizeAppLanguageSetting('foo')).toBe(AppLanguage.en) expect(sanitizeAppLanguageSetting('foo')).toBe(AppLanguage.en)
expect(sanitizeAppLanguageSetting('en,foo')).toBe(AppLanguage.en) expect(sanitizeAppLanguageSetting('en,foo')).toBe(AppLanguage.en)

View File

@ -124,6 +124,8 @@ export function sanitizeAppLanguageSetting(appLanguage: string): AppLanguage {
return AppLanguage.ja return AppLanguage.ja
case 'ko': case 'ko':
return AppLanguage.ko return AppLanguage.ko
case 'pt-BR':
return AppLanguage.pt_BR
default: default:
continue continue
} }

View File

@ -10,6 +10,7 @@ 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 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 {sanitizeAppLanguageSetting} from '#/locale/helpers' import {sanitizeAppLanguageSetting} from '#/locale/helpers'
import {AppLanguage} from '#/locale/languages' import {AppLanguage} from '#/locale/languages'
@ -44,6 +45,10 @@ export async function dynamicActivate(locale: AppLanguage) {
i18n.loadAndActivate({locale, messages: messagesKo}) i18n.loadAndActivate({locale, messages: messagesKo})
break break
} }
case AppLanguage.pt_BR: {
i18n.loadAndActivate({locale, messages: messagesPt_BR})
break
}
default: { default: {
i18n.loadAndActivate({locale, messages: messagesEn}) i18n.loadAndActivate({locale, messages: messagesEn})
break break

View File

@ -37,6 +37,10 @@ export async function dynamicActivate(locale: AppLanguage) {
mod = await import(`./locales/ko/messages`) mod = await import(`./locales/ko/messages`)
break break
} }
case AppLanguage.pt_BR: {
mod = await import(`./locales/pt-BR/messages`)
break
}
default: { default: {
mod = await import(`./locales/en/messages`) mod = await import(`./locales/en/messages`)
break break

View File

@ -13,6 +13,7 @@ export enum AppLanguage {
hi = 'hi', hi = 'hi',
ja = 'ja', ja = 'ja',
ko = 'ko', ko = 'ko',
pt_BR = 'pt-BR',
} }
interface AppLanguageConfig { interface AppLanguageConfig {
@ -29,6 +30,7 @@ export const APP_LANGUAGES: AppLanguageConfig[] = [
{code2: AppLanguage.hi, name: 'हिंदी'}, {code2: AppLanguage.hi, name: 'हिंदी'},
{code2: AppLanguage.ja, name: '日本語'}, {code2: AppLanguage.ja, name: '日本語'},
{code2: AppLanguage.ko, name: '한국어'}, {code2: AppLanguage.ko, name: '한국어'},
{code2: AppLanguage.pt_BR, name: 'Portuguese (BR)'},
] ]
export const LANGUAGES: Language[] = [ export const LANGUAGES: Language[] = [

File diff suppressed because it is too large Load Diff