UBERF-7327: Chinese language selector (#5862)

Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
Andrey Sobolev 2024-06-19 20:47:17 +07:00 committed by GitHub
parent 0ac9cdebeb
commit 1c8bdb81f7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
10 changed files with 30 additions and 26 deletions

View File

@ -1,7 +1,7 @@
{ {
"localhost:8080": { "localhost:8080": {
"title": "Platform", "title": "Platform",
"languages": "en,ru,pt,es", "languages": "en,ru,pt,es,zh",
"defaultLanguage": "en", "defaultLanguage": "en",
"defaultApplication": "tracker", "defaultApplication": "tracker",
"defaultSpace": "tracker:project:DefaultProject", "defaultSpace": "tracker:project:DefaultProject",

View File

@ -189,14 +189,15 @@ function configureI18n(): void {
export async function configurePlatform() { export async function configurePlatform() {
setMetadata(platform.metadata.LoadHelper, async (loader) => { setMetadata(platform.metadata.LoadHelper, async (loader) => {
for (let i = 0; i < 3; i++) { for (let i = 0; i < 5; i++) {
try { try {
return loader() return loader()
} catch (err: any) { } catch (err: any) {
if (err.message.includes('Loading chunk') && i != 2) { if (err.message.includes('Loading chunk') && i != 4) {
continue continue
} }
Analytics.handleError(err) Analytics.handleError(err)
location.reload()
} }
} }
}) })
@ -265,7 +266,7 @@ export async function configurePlatform() {
setMetadata(uiPlugin.metadata.DefaultApplication, login.component.LoginApp) setMetadata(uiPlugin.metadata.DefaultApplication, login.component.LoginApp)
setMetadata(contactPlugin.metadata.LastNameFirst, myBranding.lastNameFirst === 'true' ?? false) 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'] const languages = myBranding.languages ? (myBranding.languages as string).split(',').map((l) => l.trim()) : ['en', 'ru', 'es', 'pt', 'zh']
setMetadata(uiPlugin.metadata.Languages, languages) setMetadata(uiPlugin.metadata.Languages, languages)
setMetadata( setMetadata(

View File

@ -47,9 +47,10 @@
"DueDatePopupDescription": "{value, plural, =0 {Today} =1 {Tomorrow} other {# days remaining}}", "DueDatePopupDescription": "{value, plural, =0 {Today} =1 {Tomorrow} other {# days remaining}}",
"DueDatePopupOverdueDescription": "{value, plural, =1 {1 day overdue} other {# days overdue}}", "DueDatePopupOverdueDescription": "{value, plural, =1 {1 day overdue} other {# days overdue}}",
"English": "English", "English": "English",
"Russian": "Russian", "Russian": "Русский",
"Portuguese": "Portuguese", "Portuguese": "Português",
"Spanish": "Spanish", "Spanish": "Español",
"Chinese": "中文",
"MinutesBefore": "{minutes, plural, =1 {a minute before} other {# minutes before}}", "MinutesBefore": "{minutes, plural, =1 {a minute before} other {# minutes before}}",
"HoursBefore": "{hours, plural, =1 {an hour before} other {# hours before}}", "HoursBefore": "{hours, plural, =1 {an hour before} other {# hours before}}",
"DaysBefore": "{days, plural, =1 {a day before} other {# days before}}", "DaysBefore": "{days, plural, =1 {a day before} other {# days before}}",
@ -85,8 +86,6 @@
"ThemeSystem": "System", "ThemeSystem": "System",
"NoTimeZonesFound": "No time zones found", "NoTimeZonesFound": "No time zones found",
"Selected": "Selected:", "Selected": "Selected:",
"Spanish": "Spanish",
"Portuguese": "Portuguese",
"Submit": "Submit", "Submit": "Submit",
"NextStep": "Next step", "NextStep": "Next step",
"TypeHere": "Type here..." "TypeHere": "Type here..."

View File

@ -46,10 +46,11 @@
"DueDatePopupOverdueTitle": "Debía ser para el {value}", "DueDatePopupOverdueTitle": "Debía ser para el {value}",
"DueDatePopupDescription": "{value, plural, =0 {Hoy} =1 {Mañana} other {# días restantes}}", "DueDatePopupDescription": "{value, plural, =0 {Hoy} =1 {Mañana} other {# días restantes}}",
"DueDatePopupOverdueDescription": "{value, plural, =1 {1 día de retraso} other {# días de retraso}}", "DueDatePopupOverdueDescription": "{value, plural, =1 {1 día de retraso} other {# días de retraso}}",
"English": "Inglés", "English": "English",
"Russian": "Ruso", "Russian": "Русский",
"Portuguese": "Portugués", "Portuguese": "Português",
"Spanish": "Español", "Spanish": "Español",
"Chinese": "中文",
"MinutesBefore": "{minutes, plural, =1 {un minuto antes} other {# minutos antes}}", "MinutesBefore": "{minutes, plural, =1 {un minuto antes} other {# minutos antes}}",
"HoursBefore": "{hours, plural, =1 {una hora antes} other {# horas antes}}", "HoursBefore": "{hours, plural, =1 {una hora antes} other {# horas antes}}",
"DaysBefore": "{days, plural, =1 {un día antes} other {# días antes}}", "DaysBefore": "{days, plural, =1 {un día antes} other {# días antes}}",

View File

@ -46,10 +46,11 @@
"DueDatePopupOverdueTitle": "Venceu em {value}", "DueDatePopupOverdueTitle": "Venceu em {value}",
"DueDatePopupDescription": "{value, plural, =0 {Hoje} =1 {Amanhã} other {# dias restantes}}", "DueDatePopupDescription": "{value, plural, =0 {Hoje} =1 {Amanhã} other {# dias restantes}}",
"DueDatePopupOverdueDescription": "{value, plural, =1 {1 dia em atraso} other {# dias em atraso}}", "DueDatePopupOverdueDescription": "{value, plural, =1 {1 dia em atraso} other {# dias em atraso}}",
"English": "Inglês", "English": "English",
"Russian": "Russo", "Russian": "Русский",
"Portuguese": "Português", "Portuguese": "Português",
"Spanish": "Espanhol", "Spanish": "Español",
"Chinese": "中文",
"MinutesBefore": "{minutes, plural, =1 {um minuto antes} other {# minutos antes}}", "MinutesBefore": "{minutes, plural, =1 {um minuto antes} other {# minutos antes}}",
"HoursBefore": "{hours, plural, =1 {uma hora antes} other {# horas antes}}", "HoursBefore": "{hours, plural, =1 {uma hora antes} other {# horas antes}}",
"DaysBefore": "{days, plural, =1 {um dia antes} other {# dias antes}}", "DaysBefore": "{days, plural, =1 {um dia antes} other {# dias antes}}",

View File

@ -46,10 +46,11 @@
"DueDatePopupOverdueTitle": "Должно было завершится {value}", "DueDatePopupOverdueTitle": "Должно было завершится {value}",
"DueDatePopupDescription": "{value, plural, =0 {Сегодня} =1 {Завтра} one {# день остался} few {# дня осталось} other {# дней осталось}}", "DueDatePopupDescription": "{value, plural, =0 {Сегодня} =1 {Завтра} one {# день остался} few {# дня осталось} other {# дней осталось}}",
"DueDatePopupOverdueDescription": "{value, plural, one {# день опоздания} few {# дня опоздания} other {# дней опоздания}}", "DueDatePopupOverdueDescription": "{value, plural, one {# день опоздания} few {# дня опоздания} other {# дней опоздания}}",
"English": "Английский", "English": "English",
"Russian": "Русский", "Russian": "Русский",
"Spanish": "Испанский", "Spanish": "Español",
"Portuguese": "Португальский", "Portuguese": "Português",
"Chinese": "中文",
"MinutesBefore": "{minutes, plural, =1 {за минуту} one {за # минуту} few {за # минуты} other {за # минут}}", "MinutesBefore": "{minutes, plural, =1 {за минуту} one {за # минуту} few {за # минуты} other {за # минут}}",
"HoursBefore": "{hours, plural, =1 {за час} one {за # час} few {за # часа} other {за # часов}}", "HoursBefore": "{hours, plural, =1 {за час} one {за # час} few {за # часа} other {за # часов}}",
"DaysBefore": "{days, plural, =1 {за день} one {за # день} few {за # дня} other {за # дней}}", "DaysBefore": "{days, plural, =1 {за день} one {за # день} few {за # дня} other {за # дней}}",

View File

@ -46,10 +46,11 @@
"DueDatePopupOverdueTitle": "原定于 {value}", "DueDatePopupOverdueTitle": "原定于 {value}",
"DueDatePopupDescription": "{value, plural, =0 {今天} =1 {明天} other {剩余 # 天}}", "DueDatePopupDescription": "{value, plural, =0 {今天} =1 {明天} other {剩余 # 天}}",
"DueDatePopupOverdueDescription": "{value, plural, =1 {过期 1 天} other {# 天过期}}", "DueDatePopupOverdueDescription": "{value, plural, =1 {过期 1 天} other {# 天过期}}",
"English": "英语", "English": "English",
"Russian": "俄语", "Russian": "Русский",
"Portuguese": "葡萄牙语", "Portuguese": "Português",
"Spanish": "西班牙语", "Spanish": "Español",
"Chinese": "中文",
"MinutesBefore": "{minutes, plural, =1 {一分钟前} other {# 分钟前}}", "MinutesBefore": "{minutes, plural, =1 {一分钟前} other {# 分钟前}}",
"HoursBefore": "{hours, plural, =1 {一小时前} other {# 小时前}}", "HoursBefore": "{hours, plural, =1 {一小时前} other {# 小时前}}",
"DaysBefore": "{days, plural, =1 {一天前} other {# 天前}}", "DaysBefore": "{days, plural, =1 {一天前} other {# 天前}}",
@ -85,8 +86,6 @@
"ThemeSystem": "系统", "ThemeSystem": "系统",
"NoTimeZonesFound": "未找到时区", "NoTimeZonesFound": "未找到时区",
"Selected": "已选:", "Selected": "已选:",
"Spanish": "西班牙语",
"Portuguese": "葡萄牙语",
"Submit": "提交", "Submit": "提交",
"NextStep": "下一步", "NextStep": "下一步",
"TypeHere": "在此输入..." "TypeHere": "在此输入..."

View File

@ -28,7 +28,8 @@
{ id: 'en', label: ui.string.English, logo: '&#x1F1FA;&#x1F1F8;' }, { id: 'en', label: ui.string.English, logo: '&#x1F1FA;&#x1F1F8;' },
{ id: 'pt', label: ui.string.Portuguese, logo: '&#x1F1F5;&#x1F1F9;' }, { id: 'pt', label: ui.string.Portuguese, logo: '&#x1F1F5;&#x1F1F9;' },
{ id: 'es', label: ui.string.Spanish, logo: '&#x1F1EA;&#x1F1F8;' }, { id: 'es', label: ui.string.Spanish, logo: '&#x1F1EA;&#x1F1F8;' },
{ id: 'ru', label: ui.string.Russian, logo: '&#x1F1F7;&#x1F1FA;' } { id: 'ru', label: ui.string.Russian, logo: '&#x1F1F7;&#x1F1FA;' },
{ id: 'zh', label: ui.string.Chinese, logo: '&#x1F1E8;&#x1F1F3;' }
].filter((lang) => uiLangs.has(lang.id)) ].filter((lang) => uiLangs.has(lang.id))
if (langs.findIndex((l) => l.id === currentLanguage) < 0 && langs.length !== 0) { if (langs.findIndex((l) => l.id === currentLanguage) < 0 && langs.length !== 0) {
setLanguage(langs[0].id) setLanguage(langs[0].id)

View File

@ -71,6 +71,7 @@ export const uis = plugin(uiId, {
Russian: '' as IntlString, Russian: '' as IntlString,
Spanish: '' as IntlString, Spanish: '' as IntlString,
Portuguese: '' as IntlString, Portuguese: '' as IntlString,
Chinese: '' as IntlString,
MinutesBefore: '' as IntlString, MinutesBefore: '' as IntlString,
HoursBefore: '' as IntlString, HoursBefore: '' as IntlString,
DaysBefore: '' as IntlString, DaysBefore: '' as IntlString,

View File

@ -1,7 +1,7 @@
{ {
"localhost:8083": { "localhost:8083": {
"title": "Platform", "title": "Platform",
"languages": "en,ru,pt,es", "languages": "en,ru,pt,es,zh",
"defaultLanguage": "en", "defaultLanguage": "en",
"defaultApplication": "tracker", "defaultApplication": "tracker",
"defaultSpace": "tracker:project:DefaultProject", "defaultSpace": "tracker:project:DefaultProject",