diff --git a/common/translations-cli/extract.js b/common/translations-cli/extract.js index 9c6374594..618e1dddb 100644 --- a/common/translations-cli/extract.js +++ b/common/translations-cli/extract.js @@ -6,7 +6,7 @@ const { getFiles } = require('./helpers'); const readFilePromise = promisify(fs.readFile); -const translationRegex = /_t\(\s*['"]([^'"]+)['"]\s*,\s*\{\s*defaultMessage\s*:\s*['"]([^'"]+)['"]\s*\}/g; +const translationRegex = /_t\(\s*['"]([^'"]+)['"]\s*,\s*\{\s*defaultMessage\s*:\s*(?:'([^'\\]*(?:\\.[^'\\]*)*)'|"([^"\\]*(?:\\.[^"\\]*)*)"|\`([^`\\]*(?:\\.[^`\\]*)*(?:\{[^}]*\}[^`\\]*(?:\\.[^`\\]*)*)*)\`)(?:\s*,\s*[^}]*)*\s*\}/g; /** * @param {string} file @@ -20,7 +20,8 @@ async function extractTranslationsFromFile(file) { let match; while ((match = translationRegex.exec(content)) !== null) { - const [_, key, defaultText] = match; + const [_, key, singleQuotedText, doubleQuotedText, templateLiteral] = match; + const defaultText = singleQuotedText || doubleQuotedText || templateLiteral; translations[key] = defaultText; } diff --git a/packages/web/src/App.svelte b/packages/web/src/App.svelte index 4c08d2554..4f25380d9 100644 --- a/packages/web/src/App.svelte +++ b/packages/web/src/App.svelte @@ -27,7 +27,7 @@ import SettingsListener from './utility/SettingsListener.svelte'; import { handleAuthOnStartup } from './clientAuth'; import { initializeAppUpdates } from './utility/appUpdate'; - import { _t } from './translations'; + import { _t, saveSelectedLanguageToCache } from './translations'; import { installCloudListeners } from './utility/cloudListeners'; export let isAdminPage = false; @@ -61,6 +61,7 @@ initializeAppUpdates(); installCloudListeners(); refreshPublicCloudFiles(); + saveSelectedLanguageToCache(); } loadedApi = loadedApiValue; diff --git a/packages/web/src/appobj/AppObjectList.svelte b/packages/web/src/appobj/AppObjectList.svelte index ad6c2395b..89a423c48 100644 --- a/packages/web/src/appobj/AppObjectList.svelte +++ b/packages/web/src/appobj/AppObjectList.svelte @@ -40,7 +40,17 @@ $: dataLabeled = _.compact( (list || []).map(data => { - const matchResult = matcher ? matcher(data) : true; + const dataCopy = {...data, + group: (data?.group && _.isFunction(data.group)) ? data.group() : data.group, + title: (data?.title && _.isFunction(data.title)) ? data.title() : data.title, + description: (data?.description && _.isFunction(data.description)) ? data.description() : data.description, + args: (data?.args || []).map(x => ({ + ...x, + label: (x?.label && _.isFunction(x.label)) ? x.label() : x.label, + })) + }; + + const matchResult = matcher ? matcher(dataCopy) : true; let isMatched = true; let isMainMatched = true; @@ -62,8 +72,8 @@ isChildMatched = !module.disableShowChildrenWithParentMatch; } - const group = groupFunc ? groupFunc(data) : undefined; - return { group, data, isMatched, isChildMatched, isMainMatched }; + const group = groupFunc ? groupFunc(dataCopy) : undefined; + return { group, data: dataCopy, isMatched, isChildMatched, isMainMatched }; }) ); diff --git a/packages/web/src/buttons/NewObjectButton.svelte b/packages/web/src/buttons/NewObjectButton.svelte index 61d6bb5cd..17fd1944e 100644 --- a/packages/web/src/buttons/NewObjectButton.svelte +++ b/packages/web/src/buttons/NewObjectButton.svelte @@ -1,6 +1,7 @@ - + {#if foreignKeys.length > 0} -
References tables ({foreignKeys.length})
+
{_t('dataGrid.referencesTables', { defaultMessage: 'References tables' })} ({foreignKeys.length})
{#each foreignKeys.filter(fk => filterName(filter, fk.refTableName)) as fk}