Skip to content

Commit e2b842a

Browse files
authored
Add language: European Portuguese (pt-PT) (#8375)
* Update app.config.js * Update lingui.config.js * Update dates.ts * Update helpers.ts * Update i18n.ts * Update i18n.web.ts * Update languages.ts * Create messages.po * prettier
1 parent bf78453 commit e2b842a

File tree

8 files changed

+38
-1
lines changed

8 files changed

+38
-1
lines changed

app.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ module.exports = function (_config) {
9595
'nl',
9696
'pl',
9797
'pt-BR',
98+
'pt-PT',
9899
'ro',
99100
'ru',
100101
'sv',

lingui.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ module.exports = {
3131
'nl',
3232
'pl',
3333
'pt-BR',
34+
'pt-PT',
3435
'ro',
3536
'ru',
3637
'sv',

src/components/hooks/dates.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ import {
3333
ko,
3434
nl,
3535
pl,
36+
pt,
3637
ptBR,
3738
ro,
3839
ru,
@@ -82,6 +83,7 @@ const locales: Record<AppLanguage, Locale | undefined> = {
8283
ne: undefined,
8384
nl,
8485
pl,
86+
['pt-PT']: pt,
8587
['pt-BR']: ptBR,
8688
ro,
8789
ru,

src/locale/helpers.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,8 @@ export function sanitizeAppLanguageSetting(appLanguage: string): AppLanguage {
213213
return AppLanguage.pl
214214
case 'pt-BR':
215215
return AppLanguage.pt_BR
216+
case 'pt-PT':
217+
return AppLanguage.pt_PT
216218
case 'ro':
217219
return AppLanguage.ro
218220
case 'ru':

src/locale/i18n.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ import {messages as messagesNe} from '#/locale/locales/ne/messages'
4141
import {messages as messagesNl} from '#/locale/locales/nl/messages'
4242
import {messages as messagesPl} from '#/locale/locales/pl/messages'
4343
import {messages as messagesPt_BR} from '#/locale/locales/pt-BR/messages'
44+
import {messages as messagesPt_PT} from '#/locale/locales/pt-PT/messages'
4445
import {messages as messagesRo} from '#/locale/locales/ro/messages'
4546
import {messages as messagesRu} from '#/locale/locales/ru/messages'
4647
import {messages as messagesSv} from '#/locale/locales/sv/messages'
@@ -286,6 +287,14 @@ export async function dynamicActivate(locale: AppLanguage) {
286287
])
287288
break
288289
}
290+
case AppLanguage.pt_PT: {
291+
i18n.loadAndActivate({locale, messages: messagesPt_PT})
292+
await Promise.all([
293+
import('@formatjs/intl-pluralrules/locale-data/pt-PT'),
294+
import('@formatjs/intl-numberformat/locale-data/pt-PT'),
295+
])
296+
break
297+
}
289298
case AppLanguage.ro: {
290299
i18n.loadAndActivate({locale, messages: messagesRo})
291300
await Promise.all([

src/locale/i18n.web.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,10 @@ export async function dynamicActivate(locale: AppLanguage) {
128128
mod = await import(`./locales/pt-BR/messages`)
129129
break
130130
}
131+
case AppLanguage.pt_PT: {
132+
mod = await import(`./locales/pt-PT/messages`)
133+
break
134+
}
131135
case AppLanguage.ro: {
132136
mod = await import(`./locales/ro/messages`)
133137
break

src/locale/languages.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ export enum AppLanguage {
3535
nl = 'nl',
3636
pl = 'pl',
3737
pt_BR = 'pt-BR',
38+
pt_PT = 'pt-PT',
3839
ro = 'ro',
3940
ru = 'ru',
4041
sv = 'sv',
@@ -82,7 +83,11 @@ export const APP_LANGUAGES: AppLanguageConfig[] = [
8283
{code2: AppLanguage.ne, name: 'नेपाली – Nepali'},
8384
{code2: AppLanguage.nl, name: 'Nederlands – Dutch'},
8485
{code2: AppLanguage.pl, name: 'Polski – Polish'},
85-
{code2: AppLanguage.pt_BR, name: 'Português (BR) – Portuguese (BR)'},
86+
{
87+
code2: AppLanguage.pt_BR,
88+
name: 'português do Brasil – Brazilian Portuguese',
89+
},
90+
{code2: AppLanguage.pt_PT, name: 'português europeu – European Portuguese'},
8691
{code2: AppLanguage.ro, name: 'Română – Romanian'},
8792
{code2: AppLanguage.ru, name: 'Русский – Russian'},
8893
{code2: AppLanguage.sv, name: 'Svenska – Swedish'},
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
msgid ""
2+
msgstr ""
3+
"POT-Creation-Date: 2023-11-05 16:01-0800\n"
4+
"MIME-Version: 1.0\n"
5+
"Content-Type: text/plain; charset=UTF-8\n"
6+
"Content-Transfer-Encoding: 8bit\n"
7+
"X-Generator: @lingui/cli\n"
8+
"Language: pt-PT\n"
9+
"Project-Id-Version: 49a8cb746fbc2ae5707392ee41ddec4c\n"
10+
"Report-Msgid-Bugs-To: \n"
11+
"PO-Revision-Date: 2025-05-16 15:40\n"
12+
"Last-Translator: \n"
13+
"Language-Team: European Portuguese\n"

0 commit comments

Comments
 (0)