From 1b9cf87b73ecf52ac9dba925b18859d0d83a88e5 Mon Sep 17 00:00:00 2001 From: Alexey Zinoviev Date: Thu, 20 Jun 2024 19:36:09 +0400 Subject: [PATCH] uberf-7342: add french lang selector (#5873) Signed-off-by: Alexey Zinoviev --- dev/prod/public/branding.json | 4 ++-- dev/prod/src/platform.ts | 6 +++--- packages/ui/lang/en.json | 1 + packages/ui/lang/es.json | 1 + packages/ui/lang/fr.json | 2 +- packages/ui/lang/pt.json | 1 + packages/ui/lang/ru.json | 1 + packages/ui/lang/zh.json | 1 + packages/ui/src/components/internal/LangSelector.svelte | 3 ++- packages/ui/src/plugin.ts | 1 + tests/branding-test.json | 2 +- 11 files changed, 15 insertions(+), 8 deletions(-) diff --git a/dev/prod/public/branding.json b/dev/prod/public/branding.json index ec27f107a3..eee32661e0 100644 --- a/dev/prod/public/branding.json +++ b/dev/prod/public/branding.json @@ -1,7 +1,7 @@ { "localhost:8080": { "title": "Platform", - "languages": "en,ru,pt,es,zh", + "languages": "en,ru,pt,es,zh,fr", "defaultLanguage": "en", "defaultApplication": "tracker", "defaultSpace": "tracker:project:DefaultProject", @@ -29,7 +29,7 @@ }, "localhost:8087": { "title": "DevPlatform", - "languages": "en,ru,pt,es", + "languages": "en,ru,pt,es,zh,fr", "defaultLanguage": "en", "defaultApplication": "tracker", "defaultSpace": "tracker:project:DefaultProject", diff --git a/dev/prod/src/platform.ts b/dev/prod/src/platform.ts index f45b741020..1cfad1b913 100644 --- a/dev/prod/src/platform.ts +++ b/dev/prod/src/platform.ts @@ -189,11 +189,11 @@ function configureI18n(): void { export async function configurePlatform() { setMetadata(platform.metadata.LoadHelper, async (loader) => { - for (let i = 0; i < 5; i++) { + for (let i = 0; i < 6; i++) { try { return loader() } catch (err: any) { - if (err.message.includes('Loading chunk') && i != 4) { + if (err.message.includes('Loading chunk') && i != 5) { continue } Analytics.handleError(err) @@ -266,7 +266,7 @@ export async function configurePlatform() { setMetadata(uiPlugin.metadata.DefaultApplication, login.component.LoginApp) setMetadata(contactPlugin.metadata.LastNameFirst, myBranding.lastNameFirst === 'true' ?? false) - const languages = myBranding.languages ? (myBranding.languages as string).split(',').map((l) => l.trim()) : ['en', 'ru', 'es', 'pt', 'zh'] + const languages = myBranding.languages ? (myBranding.languages as string).split(',').map((l) => l.trim()) : ['en', 'ru', 'es', 'pt', 'zh', 'fr'] setMetadata(uiPlugin.metadata.Languages, languages) setMetadata( diff --git a/packages/ui/lang/en.json b/packages/ui/lang/en.json index 85af4b0412..171ec0d288 100644 --- a/packages/ui/lang/en.json +++ b/packages/ui/lang/en.json @@ -51,6 +51,7 @@ "Portuguese": "Português", "Spanish": "Español", "Chinese": "中文", + "French": "Français", "MinutesBefore": "{minutes, plural, =1 {a minute before} other {# minutes before}}", "HoursBefore": "{hours, plural, =1 {an hour before} other {# hours before}}", "DaysBefore": "{days, plural, =1 {a day before} other {# days before}}", diff --git a/packages/ui/lang/es.json b/packages/ui/lang/es.json index 2727be045d..147ecb569a 100644 --- a/packages/ui/lang/es.json +++ b/packages/ui/lang/es.json @@ -51,6 +51,7 @@ "Portuguese": "Português", "Spanish": "Español", "Chinese": "中文", + "French": "Français", "MinutesBefore": "{minutes, plural, =1 {un minuto antes} other {# minutos antes}}", "HoursBefore": "{hours, plural, =1 {una hora antes} other {# horas antes}}", "DaysBefore": "{days, plural, =1 {un día antes} other {# días antes}}", diff --git a/packages/ui/lang/fr.json b/packages/ui/lang/fr.json index 33bc014c3a..fab8b19cb7 100644 --- a/packages/ui/lang/fr.json +++ b/packages/ui/lang/fr.json @@ -46,7 +46,7 @@ "DueDatePopupOverdueTitle": "Était à échéance le {value}", "DueDatePopupDescription": "{value, plural, =0 {Aujourd'hui} =1 {Demain} other {# jours restants}}", "DueDatePopupOverdueDescription": "{value, plural, =1 {1 jour de retard} other {# jours de retard}}", - "English": "Anglais", + "English": "English", "Russian": "Русский", "Portuguese": "Português", "Spanish": "Español", diff --git a/packages/ui/lang/pt.json b/packages/ui/lang/pt.json index 75b38005c6..bcde3e23b2 100644 --- a/packages/ui/lang/pt.json +++ b/packages/ui/lang/pt.json @@ -51,6 +51,7 @@ "Portuguese": "Português", "Spanish": "Español", "Chinese": "中文", + "French": "Français", "MinutesBefore": "{minutes, plural, =1 {um minuto antes} other {# minutos antes}}", "HoursBefore": "{hours, plural, =1 {uma hora antes} other {# horas antes}}", "DaysBefore": "{days, plural, =1 {um dia antes} other {# dias antes}}", diff --git a/packages/ui/lang/ru.json b/packages/ui/lang/ru.json index 91d43c6419..3928b7d175 100644 --- a/packages/ui/lang/ru.json +++ b/packages/ui/lang/ru.json @@ -51,6 +51,7 @@ "Spanish": "Español", "Portuguese": "Português", "Chinese": "中文", + "French": "Français", "MinutesBefore": "{minutes, plural, =1 {за минуту} one {за # минуту} few {за # минуты} other {за # минут}}", "HoursBefore": "{hours, plural, =1 {за час} one {за # час} few {за # часа} other {за # часов}}", "DaysBefore": "{days, plural, =1 {за день} one {за # день} few {за # дня} other {за # дней}}", diff --git a/packages/ui/lang/zh.json b/packages/ui/lang/zh.json index 473ca54aac..8442dcae55 100644 --- a/packages/ui/lang/zh.json +++ b/packages/ui/lang/zh.json @@ -51,6 +51,7 @@ "Portuguese": "Português", "Spanish": "Español", "Chinese": "中文", + "French": "Français", "MinutesBefore": "{minutes, plural, =1 {一分钟前} other {# 分钟前}}", "HoursBefore": "{hours, plural, =1 {一小时前} other {# 小时前}}", "DaysBefore": "{days, plural, =1 {一天前} other {# 天前}}", diff --git a/packages/ui/src/components/internal/LangSelector.svelte b/packages/ui/src/components/internal/LangSelector.svelte index cd0c2e2865..2d78ed7b48 100644 --- a/packages/ui/src/components/internal/LangSelector.svelte +++ b/packages/ui/src/components/internal/LangSelector.svelte @@ -29,7 +29,8 @@ { id: 'pt', label: ui.string.Portuguese, logo: '🇵🇹' }, { id: 'es', label: ui.string.Spanish, logo: '🇪🇸' }, { id: 'ru', label: ui.string.Russian, logo: '🇷🇺' }, - { id: 'zh', label: ui.string.Chinese, logo: '🇨🇳' } + { id: 'zh', label: ui.string.Chinese, logo: '🇨🇳' }, + { id: 'fr', label: ui.string.French, logo: '🇫🇷' } ].filter((lang) => uiLangs.has(lang.id)) if (langs.findIndex((l) => l.id === currentLanguage) < 0 && langs.length !== 0) { setLanguage(langs[0].id) diff --git a/packages/ui/src/plugin.ts b/packages/ui/src/plugin.ts index 4d2eeb56ee..b65b275e12 100644 --- a/packages/ui/src/plugin.ts +++ b/packages/ui/src/plugin.ts @@ -72,6 +72,7 @@ export const uis = plugin(uiId, { Spanish: '' as IntlString, Portuguese: '' as IntlString, Chinese: '' as IntlString, + French: '' as IntlString, MinutesBefore: '' as IntlString, HoursBefore: '' as IntlString, DaysBefore: '' as IntlString, diff --git a/tests/branding-test.json b/tests/branding-test.json index 63aa30da58..56c169ddfe 100644 --- a/tests/branding-test.json +++ b/tests/branding-test.json @@ -1,7 +1,7 @@ { "localhost:8083": { "title": "Platform", - "languages": "en,ru,pt,es,zh", + "languages": "en,ru,pt,es,zh,fr", "defaultLanguage": "en", "defaultApplication": "tracker", "defaultSpace": "tracker:project:DefaultProject",