diff --git a/dev/prod/src/platform.ts b/dev/prod/src/platform.ts index 879a5e610d..6ae1c81b99 100644 --- a/dev/prod/src/platform.ts +++ b/dev/prod/src/platform.ts @@ -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( diff --git a/dev/tool/package.json b/dev/tool/package.json index 3efcd53fe8..433298ee5f 100644 --- a/dev/tool/package.json +++ b/dev/tool/package.json @@ -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" } } diff --git a/packages/platform/src/i18n.ts b/packages/platform/src/i18n.ts index e5c2071156..d6a4261405 100644 --- a/packages/platform/src/i18n.ts +++ b/packages/platform/src/i18n.ts @@ -70,10 +70,14 @@ async function loadTranslationsForComponent (plugin: Plugin, locale: string): Pr try { return (await loader(locale)) as Record | 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 | Status + } catch (err: any) { + const status = unknownError(err) + await setPlatformStatus(status) + return status + } } } diff --git a/packages/ui/lang/en.json b/packages/ui/lang/en.json index 83ba2b97ae..241b2a9090 100644 --- a/packages/ui/lang/en.json +++ b/packages/ui/lang/en.json @@ -82,6 +82,8 @@ "ThemeDark": "Dark", "ThemeSystem": "System", "NoTimeZonesFound": "No time zones found", - "Selected": "Selected:" + "Selected": "Selected:", + "Spanish": "Spanish", + "Portuguese": "Portuguese" } } diff --git a/packages/ui/lang/ru.json b/packages/ui/lang/ru.json index ccc019adc8..fdec096e7a 100644 --- a/packages/ui/lang/ru.json +++ b/packages/ui/lang/ru.json @@ -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 {за # дней}}", diff --git a/packages/ui/src/components/internal/LangSelector.svelte b/packages/ui/src/components/internal/LangSelector.svelte index 8c389d03db..01ba5ab06c 100644 --- a/packages/ui/src/components/internal/LangSelector.svelte +++ b/packages/ui/src/components/internal/LangSelector.svelte @@ -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) } diff --git a/packages/ui/src/plugin.ts b/packages/ui/src/plugin.ts index 70e59a8740..67a15ea656 100644 --- a/packages/ui/src/plugin.ts +++ b/packages/ui/src/plugin.ts @@ -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, diff --git a/plugins/inventory-assets/lang/es_es.json b/plugins/inventory-assets/lang/es.json similarity index 100% rename from plugins/inventory-assets/lang/es_es.json rename to plugins/inventory-assets/lang/es.json diff --git a/plugins/inventory-assets/lang/pt_pt.json b/plugins/inventory-assets/lang/pt.json similarity index 100% rename from plugins/inventory-assets/lang/pt_pt.json rename to plugins/inventory-assets/lang/pt.json diff --git a/plugins/lead-assets/lang/es_es.json b/plugins/lead-assets/lang/es.json similarity index 100% rename from plugins/lead-assets/lang/es_es.json rename to plugins/lead-assets/lang/es.json diff --git a/plugins/lead-assets/lang/pt_pt.json b/plugins/lead-assets/lang/pt.json similarity index 100% rename from plugins/lead-assets/lang/pt_pt.json rename to plugins/lead-assets/lang/pt.json diff --git a/plugins/login-assets/lang/es_es.json b/plugins/login-assets/lang/es.json similarity index 100% rename from plugins/login-assets/lang/es_es.json rename to plugins/login-assets/lang/es.json diff --git a/plugins/login-assets/lang/pt_pt.json b/plugins/login-assets/lang/pt.json similarity index 100% rename from plugins/login-assets/lang/pt_pt.json rename to plugins/login-assets/lang/pt.json diff --git a/plugins/notification-assets/lang/es_es.json b/plugins/notification-assets/lang/es.json similarity index 100% rename from plugins/notification-assets/lang/es_es.json rename to plugins/notification-assets/lang/es.json diff --git a/plugins/notification-assets/lang/pt_pt.json b/plugins/notification-assets/lang/pt.json similarity index 100% rename from plugins/notification-assets/lang/pt_pt.json rename to plugins/notification-assets/lang/pt.json diff --git a/plugins/preference-assets/lang/es_es.json b/plugins/preference-assets/lang/es.json similarity index 100% rename from plugins/preference-assets/lang/es_es.json rename to plugins/preference-assets/lang/es.json diff --git a/plugins/preference-assets/lang/pt_pt.json b/plugins/preference-assets/lang/pt.json similarity index 100% rename from plugins/preference-assets/lang/pt_pt.json rename to plugins/preference-assets/lang/pt.json diff --git a/plugins/recruit-assets/lang/es_es.json b/plugins/recruit-assets/lang/es.json similarity index 100% rename from plugins/recruit-assets/lang/es_es.json rename to plugins/recruit-assets/lang/es.json diff --git a/plugins/recruit-assets/lang/pt_pt.json b/plugins/recruit-assets/lang/pt.json similarity index 100% rename from plugins/recruit-assets/lang/pt_pt.json rename to plugins/recruit-assets/lang/pt.json diff --git a/plugins/request-assets/lang/es_es.json b/plugins/request-assets/lang/es.json similarity index 100% rename from plugins/request-assets/lang/es_es.json rename to plugins/request-assets/lang/es.json diff --git a/plugins/request-assets/lang/pt_pt.json b/plugins/request-assets/lang/pt.json similarity index 100% rename from plugins/request-assets/lang/pt_pt.json rename to plugins/request-assets/lang/pt.json diff --git a/plugins/setting-assets/lang/es_es.json b/plugins/setting-assets/lang/es.json similarity index 100% rename from plugins/setting-assets/lang/es_es.json rename to plugins/setting-assets/lang/es.json diff --git a/plugins/setting-assets/lang/pt_pt.json b/plugins/setting-assets/lang/pt.json similarity index 100% rename from plugins/setting-assets/lang/pt_pt.json rename to plugins/setting-assets/lang/pt.json diff --git a/plugins/support-assets/lang/es_es.json b/plugins/support-assets/lang/es.json similarity index 100% rename from plugins/support-assets/lang/es_es.json rename to plugins/support-assets/lang/es.json diff --git a/plugins/support-assets/lang/pt_pt.json b/plugins/support-assets/lang/pt.json similarity index 100% rename from plugins/support-assets/lang/pt_pt.json rename to plugins/support-assets/lang/pt.json diff --git a/plugins/tags-assets/lang/es_es.json b/plugins/tags-assets/lang/es.json similarity index 100% rename from plugins/tags-assets/lang/es_es.json rename to plugins/tags-assets/lang/es.json diff --git a/plugins/tags-assets/lang/pt_pt.json b/plugins/tags-assets/lang/pt.json similarity index 100% rename from plugins/tags-assets/lang/pt_pt.json rename to plugins/tags-assets/lang/pt.json diff --git a/plugins/task-assets/lang/es_es.json b/plugins/task-assets/lang/es.json similarity index 100% rename from plugins/task-assets/lang/es_es.json rename to plugins/task-assets/lang/es.json diff --git a/plugins/task-assets/lang/pt_pt.json b/plugins/task-assets/lang/pt.json similarity index 100% rename from plugins/task-assets/lang/pt_pt.json rename to plugins/task-assets/lang/pt.json diff --git a/plugins/telegram-assets/lang/es_es.json b/plugins/telegram-assets/lang/es.json similarity index 100% rename from plugins/telegram-assets/lang/es_es.json rename to plugins/telegram-assets/lang/es.json diff --git a/plugins/telegram-assets/lang/pt_pt.json b/plugins/telegram-assets/lang/pt.json similarity index 100% rename from plugins/telegram-assets/lang/pt_pt.json rename to plugins/telegram-assets/lang/pt.json diff --git a/plugins/templates-assets/lang/es_es.json b/plugins/templates-assets/lang/es.json similarity index 100% rename from plugins/templates-assets/lang/es_es.json rename to plugins/templates-assets/lang/es.json diff --git a/plugins/templates-assets/lang/pt_pt.json b/plugins/templates-assets/lang/pt.json similarity index 100% rename from plugins/templates-assets/lang/pt_pt.json rename to plugins/templates-assets/lang/pt.json diff --git a/plugins/tracker-assets/lang/es_es.json b/plugins/tracker-assets/lang/es.json similarity index 100% rename from plugins/tracker-assets/lang/es_es.json rename to plugins/tracker-assets/lang/es.json diff --git a/plugins/tracker-assets/lang/pt_pt.json b/plugins/tracker-assets/lang/pt.json similarity index 100% rename from plugins/tracker-assets/lang/pt_pt.json rename to plugins/tracker-assets/lang/pt.json diff --git a/plugins/view-assets/lang/es_es.json b/plugins/view-assets/lang/es.json similarity index 100% rename from plugins/view-assets/lang/es_es.json rename to plugins/view-assets/lang/es.json diff --git a/plugins/view-assets/lang/pt_pt.json b/plugins/view-assets/lang/pt.json similarity index 100% rename from plugins/view-assets/lang/pt_pt.json rename to plugins/view-assets/lang/pt.json diff --git a/plugins/workbench-assets/lang/es_es.json b/plugins/workbench-assets/lang/es.json similarity index 100% rename from plugins/workbench-assets/lang/es_es.json rename to plugins/workbench-assets/lang/es.json diff --git a/plugins/workbench-assets/lang/pt_pt.json b/plugins/workbench-assets/lang/pt.json similarity index 100% rename from plugins/workbench-assets/lang/pt_pt.json rename to plugins/workbench-assets/lang/pt.json diff --git a/server/account/lang/es_es.json b/server/account/lang/es.json similarity index 100% rename from server/account/lang/es_es.json rename to server/account/lang/es.json diff --git a/server/account/lang/pt_pt.json b/server/account/lang/pt.json similarity index 100% rename from server/account/lang/pt_pt.json rename to server/account/lang/pt.json