Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions app.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,9 @@ module.exports = function (config) {
'ko',
'nl',
'pl',
'pt',
'pt-BR',
'pt-PT',
'ru',
'th',
'tr',
Expand Down
1 change: 1 addition & 0 deletions lingui.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ module.exports = {
'nl',
'pl',
'pt-BR',
'pt-PT',
'ru',
'th',
'tr',
Expand Down
2 changes: 2 additions & 0 deletions src/components/hooks/dates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import {
ko,
nl,
pl,
pt,
ptBR,
ru,
th,
Expand Down Expand Up @@ -62,6 +63,7 @@ const locales: Record<AppLanguage, Locale | undefined> = {
ko,
nl,
pl,
['pt-PT']: pt,
['pt-BR']: ptBR,
ru,
th,
Expand Down
4 changes: 4 additions & 0 deletions src/locale/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,10 @@ export function sanitizeAppLanguageSetting(appLanguage: string): AppLanguage {
return AppLanguage.pl
case 'pt-BR':
return AppLanguage.pt_BR
case 'pt-PT':
Comment thread
joaomendoncaa marked this conversation as resolved.
Outdated
return AppLanguage.pt_PT
case 'pt':
return AppLanguage.pt_BR
case 'ru':
return AppLanguage.ru
case 'th':
Expand Down
10 changes: 10 additions & 0 deletions src/locale/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import {messages as messagesKo} from '#/locale/locales/ko/messages'
import {messages as messagesNl} from '#/locale/locales/nl/messages'
import {messages as messagesPl} from '#/locale/locales/pl/messages'
import {messages as messagesPt_BR} from '#/locale/locales/pt-BR/messages'
import {messages as messagesPt_PT} from '#/locale/locales/pt-PT/messages'
Comment thread
joaomendoncaa marked this conversation as resolved.
Outdated
import {messages as messagesRu} from '#/locale/locales/ru/messages'
import {messages as messagesTh} from '#/locale/locales/th/messages'
import {messages as messagesTr} from '#/locale/locales/tr/messages'
Expand Down Expand Up @@ -198,6 +199,15 @@ export async function dynamicActivate(locale: AppLanguage) {
])
break
}
case AppLanguage.pt_PT: {
i18n.loadAndActivate({locale, messages: messagesPt_PT})
await Promise.all([
import('@formatjs/intl-datetimeformat/locale-data/pt-PT'),
import('@formatjs/intl-pluralrules/locale-data/pt-PT'),
Comment thread
joaomendoncaa marked this conversation as resolved.
import('@formatjs/intl-numberformat/locale-data/pt-PT'),
])
break
}
case AppLanguage.ru: {
i18n.loadAndActivate({locale, messages: messagesRu})
await Promise.all([
Expand Down
4 changes: 4 additions & 0 deletions src/locale/i18n.web.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@ export async function dynamicActivate(locale: AppLanguage) {
mod = await import(`./locales/pt-BR/messages`)
break
}
case AppLanguage.pt_PT: {
mod = await import(`./locales/pt-PT/messages`)
Comment thread
joaomendoncaa marked this conversation as resolved.
Outdated
break
}
case AppLanguage.ru: {
mod = await import(`./locales/ru/messages`)
break
Expand Down
2 changes: 2 additions & 0 deletions src/locale/languages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export enum AppLanguage {
nl = 'nl',
pl = 'pl',
pt_BR = 'pt-BR',
pt_PT = 'pt-PT',
ru = 'ru',
th = 'th',
tr = 'tr',
Expand Down Expand Up @@ -61,6 +62,7 @@ export const APP_LANGUAGES: AppLanguageConfig[] = [
{code2: AppLanguage.nl, name: 'Nederlands – Dutch'},
{code2: AppLanguage.pl, name: 'Polski – Polish'},
{code2: AppLanguage.pt_BR, name: 'Português (BR) – Portuguese (BR)'},
{code2: AppLanguage.pt_PT, name: 'Português (PT) – Portuguese (PT)'},
{code2: AppLanguage.ru, name: 'Русский – Russian'},
{code2: AppLanguage.th, name: 'ภาษาไทย – Thai'},
{code2: AppLanguage.tr, name: 'Türkçe – Turkish'},
Expand Down
Loading