Skip to content
Merged
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
1 change: 1 addition & 0 deletions app.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ module.exports = function (_config) {
'nl',
'pl',
'pt-BR',
'pt-PT',
'ro',
'ru',
'sv',
Expand Down
1 change: 1 addition & 0 deletions lingui.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ module.exports = {
'nl',
'pl',
'pt-BR',
'pt-PT',
'ro',
'ru',
'sv',
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 @@ -33,6 +33,7 @@ import {
ko,
nl,
pl,
pt,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

date-fns uses pt for pt-PT

ptBR,
ro,
ru,
Expand Down Expand Up @@ -82,6 +83,7 @@ const locales: Record<AppLanguage, Locale | undefined> = {
ne: undefined,
nl,
pl,
['pt-PT']: pt,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto here

['pt-BR']: ptBR,
ro,
ru,
Expand Down
2 changes: 2 additions & 0 deletions src/locale/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,8 @@ export function sanitizeAppLanguageSetting(appLanguage: string): AppLanguage {
return AppLanguage.pl
case 'pt-BR':
return AppLanguage.pt_BR
case 'pt-PT':
return AppLanguage.pt_PT
case 'ro':
return AppLanguage.ro
case 'ru':
Expand Down
9 changes: 9 additions & 0 deletions src/locale/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ import {messages as messagesNe} from '#/locale/locales/ne/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'
import {messages as messagesRo} from '#/locale/locales/ro/messages'
import {messages as messagesRu} from '#/locale/locales/ru/messages'
import {messages as messagesSv} from '#/locale/locales/sv/messages'
Expand Down Expand Up @@ -286,6 +287,14 @@ export async function dynamicActivate(locale: AppLanguage) {
])
break
}
case AppLanguage.pt_PT: {
i18n.loadAndActivate({locale, messages: messagesPt_PT})
await Promise.all([
import('@formatjs/intl-pluralrules/locale-data/pt-PT'),
import('@formatjs/intl-numberformat/locale-data/pt-PT'),
])
break
}
case AppLanguage.ro: {
i18n.loadAndActivate({locale, messages: messagesRo})
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 @@ -128,6 +128,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`)
break
}
case AppLanguage.ro: {
mod = await import(`./locales/ro/messages`)
break
Expand Down
7 changes: 6 additions & 1 deletion src/locale/languages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export enum AppLanguage {
nl = 'nl',
pl = 'pl',
pt_BR = 'pt-BR',
pt_PT = 'pt-PT',
ro = 'ro',
ru = 'ru',
sv = 'sv',
Expand Down Expand Up @@ -82,7 +83,11 @@ export const APP_LANGUAGES: AppLanguageConfig[] = [
{code2: AppLanguage.ne, name: 'नेपाली – Nepali'},
{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_BR,
name: 'português do Brasil – Brazilian Portuguese',

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated the endonym and the English name for pt-BR to português do Brasil and Brazilian Portuguese respectively, following the CLDR locale name data

IMG_6458

},
{code2: AppLanguage.pt_PT, name: 'português europeu – European Portuguese'},
{code2: AppLanguage.ro, name: 'Română – Romanian'},
{code2: AppLanguage.ru, name: 'Русский – Russian'},
{code2: AppLanguage.sv, name: 'Svenska – Swedish'},
Expand Down
13 changes: 13 additions & 0 deletions src/locale/locales/pt-PT/messages.po
Original file line number Diff line number Diff line change
@@ -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: pt-PT\n"
"Project-Id-Version: 49a8cb746fbc2ae5707392ee41ddec4c\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2025-05-16 15:40\n"
"Last-Translator: \n"
"Language-Team: European Portuguese\n"