mirror of
https://github.com/hcengineering/platform.git
synced 2024-12-22 11:01:54 +03:00
Enable and fix pt and es languages (#4792)
Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
parent
604e37576a
commit
1967e8e5dc
@ -164,7 +164,7 @@ export async function configurePlatform() {
|
||||
setMetadata(uiPlugin.metadata.SearchPopup, view.component.ActionsPopup)
|
||||
|
||||
setMetadata(contactPlugin.metadata.LastNameFirst, config.LAST_NAME_FIRST === 'true' ?? false)
|
||||
const languages = config.LANGUAGES ? (config.LANGUAGES as string).split(',').map((l) => l.trim()) : ['en', 'ru']
|
||||
const languages = config.LANGUAGES ? (config.LANGUAGES as string).split(',').map((l) => l.trim()) : ['en', 'ru', 'es', 'pt']
|
||||
|
||||
setMetadata(uiPlugin.metadata.Languages, languages)
|
||||
setMetadata(
|
||||
|
@ -45,7 +45,6 @@
|
||||
"prettier": "^3.1.0",
|
||||
"typescript": "^5.3.3",
|
||||
"@types/ws": "^8.5.3",
|
||||
"@types/xml2js": "~0.4.9",
|
||||
"@types/mime-types": "~2.1.1",
|
||||
"@types/request": "~2.48.8",
|
||||
"jest": "^29.7.0",
|
||||
@ -134,7 +133,6 @@
|
||||
"libphonenumber-js": "^1.9.46",
|
||||
"mime-types": "~2.1.34",
|
||||
"mongodb": "^6.3.0",
|
||||
"ws": "^8.10.0",
|
||||
"xml2js": "~0.4.23"
|
||||
"ws": "^8.10.0"
|
||||
}
|
||||
}
|
||||
|
@ -70,10 +70,14 @@ async function loadTranslationsForComponent (plugin: Plugin, locale: string): Pr
|
||||
try {
|
||||
return (await loader(locale)) as Record<string, IntlString> | Status
|
||||
} catch (err) {
|
||||
console.error(err)
|
||||
const status = unknownError(err)
|
||||
await setPlatformStatus(status)
|
||||
return status
|
||||
console.error('No translations found for plugin', plugin, err)
|
||||
try {
|
||||
return (await loader('en')) as Record<string, IntlString> | Status
|
||||
} catch (err: any) {
|
||||
const status = unknownError(err)
|
||||
await setPlatformStatus(status)
|
||||
return status
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -82,6 +82,8 @@
|
||||
"ThemeDark": "Dark",
|
||||
"ThemeSystem": "System",
|
||||
"NoTimeZonesFound": "No time zones found",
|
||||
"Selected": "Selected:"
|
||||
"Selected": "Selected:",
|
||||
"Spanish": "Spanish",
|
||||
"Portuguese": "Portuguese"
|
||||
}
|
||||
}
|
||||
|
@ -48,6 +48,8 @@
|
||||
"DueDatePopupOverdueDescription": "{value, plural, one {# день опоздания} few {# дня опоздания} other {# дней опоздания}}",
|
||||
"English": "Английский",
|
||||
"Russian": "Русский",
|
||||
"Spanish": "Испанский",
|
||||
"Portuguese": "Португальский",
|
||||
"MinutesBefore": "{minutes, plural, =1 {за минуту} one {за # минуту} few {за # минуты} other {за # минут}}",
|
||||
"HoursBefore": "{hours, plural, =1 {за час} one {за # час} few {за # часа} other {за # часов}}",
|
||||
"DaysBefore": "{days, plural, =1 {за день} one {за # день} few {за # дня} other {за # дней}}",
|
||||
|
@ -26,9 +26,10 @@
|
||||
const uiLangs = new Set(getMetadata(ui.metadata.Languages))
|
||||
const langs = [
|
||||
{ id: 'en', label: ui.string.English, logo: '🇺🇸' },
|
||||
{ id: 'pt', label: ui.string.Portuguese, logo: '🇵🇹' },
|
||||
{ id: 'es', label: ui.string.Spanish, logo: '🇪🇸' },
|
||||
{ id: 'ru', label: ui.string.Russian, logo: '🇷🇺' }
|
||||
].filter((lang) => uiLangs.has(lang.id))
|
||||
|
||||
if (langs.findIndex((l) => l.id === currentLanguage) < 0 && langs.length !== 0) {
|
||||
setLanguage(langs[0].id)
|
||||
}
|
||||
|
@ -69,6 +69,8 @@ export const uis = plugin(uiId, {
|
||||
NeedsToBeCompletedByThisDate: '' as IntlString,
|
||||
English: '' as IntlString,
|
||||
Russian: '' as IntlString,
|
||||
Spanish: '' as IntlString,
|
||||
Portuguese: '' as IntlString,
|
||||
MinutesBefore: '' as IntlString,
|
||||
HoursBefore: '' as IntlString,
|
||||
DaysBefore: '' as IntlString,
|
||||
|
Loading…
Reference in New Issue
Block a user