From e1ec94faa7cfd6ae55730f374ba6434b0bcd563e Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 3 Apr 2023 11:28:27 -0400 Subject: [PATCH 1/6] automated update to translation keys (#479) Co-authored-by: Paul's Grist Bot --- static/locales/en.client.json | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/static/locales/en.client.json b/static/locales/en.client.json index 5f5a7db6..55d5e389 100644 --- a/static/locales/en.client.json +++ b/static/locales/en.client.json @@ -407,7 +407,9 @@ "Welcome to {{orgName}}": "Welcome to {{orgName}}", "You have read-only access to this site. Currently there are no documents.": "You have read-only access to this site. Currently there are no documents.", "personal site": "personal site", - "{{signUp}} to save your work. ": "{{signUp}} to save your work. " + "{{signUp}} to save your work. ": "{{signUp}} to save your work. ", + "Welcome to Grist, {{- name}}!": "Welcome to Grist, {{- name}}!", + "Welcome to {{- orgName}}": "Welcome to {{- orgName}}" }, "HomeLeftPane": { "Access Details": "Access Details", @@ -422,7 +424,8 @@ "Rename": "Rename", "Trash": "Trash", "Workspace will be moved to Trash.": "Workspace will be moved to Trash.", - "Workspaces": "Workspaces" + "Workspaces": "Workspaces", + "Tutorial": "Tutorial" }, "Importer": { "Merge rows that match these fields:": "Merge rows that match these fields:", @@ -961,7 +964,8 @@ "Access Rules": "Access Rules", "Access rules give you the power to create nuanced rules to determine who can see or edit which parts of your document.": "Access rules give you the power to create nuanced rules to determine who can see or edit which parts of your document.", "Add New": "Add New", - "Use the 𝚺 icon to create summary (or pivot) tables, for totals or subtotals.": "Use the 𝚺 icon to create summary (or pivot) tables, for totals or subtotals." + "Use the 𝚺 icon to create summary (or pivot) tables, for totals or subtotals.": "Use the 𝚺 icon to create summary (or pivot) tables, for totals or subtotals.", + "Anchor Links": "Anchor Links" }, "DescriptionConfig": { "DESCRIPTION": "DESCRIPTION" From f5eb8f773099943c4377e98f55e1d237c065067d Mon Sep 17 00:00:00 2001 From: Paul Fitzpatrick Date: Mon, 3 Apr 2023 12:55:08 -0400 Subject: [PATCH 2/6] do not count unready translations in localization test (#480) This updates the expected count of languages in a localization test to omit translations that have been started but are not yet ready to be offered to users by default. --- app/client/components/GristDoc.ts | 4 ++-- test/nbrowser/Localization.ts | 11 ++++++++++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/app/client/components/GristDoc.ts b/app/client/components/GristDoc.ts index 03176482..36dc9b22 100644 --- a/app/client/components/GristDoc.ts +++ b/app/client/components/GristDoc.ts @@ -1317,7 +1317,7 @@ export class GristDoc extends DisposableWithEvents { const options = section.options(); const colIds = section.viewFields().all().map((f) => f.column().colId()); const chartType = section.chartType(); - const theme = section.theme(); + const sectionTheme = section.theme(); // we must read the current layout from the view layout because it can override the one in // `section.layoutSpec` (in particular it provides a default layout when missing from the @@ -1351,7 +1351,7 @@ export class GristDoc extends DisposableWithEvents { } // update theme, and chart type - await newSection.theme.saveOnly(theme); + await newSection.theme.saveOnly(sectionTheme); await newSection.chartType.saveOnly(chartType); // The newly-added section should be given focus. diff --git a/test/nbrowser/Localization.ts b/test/nbrowser/Localization.ts index 4ae6fd45..d7918d50 100644 --- a/test/nbrowser/Localization.ts +++ b/test/nbrowser/Localization.ts @@ -41,14 +41,23 @@ describe("Localization", function() { const namespaces: Set = new Set(); for (const file of fs.readdirSync(localeDirectory)) { if (file.endsWith(".json")) { - const lang = file.split('.')[0]?.replace(/_/g, '-'); + const langRaw = file.split('.')[0]; + const lang = langRaw?.replace(/_/g, '-'); const ns = file.split('.')[1]; + const clientFile = path.join(localeDirectory, + `${langRaw}.client.json`); + const clientText = fs.readFileSync(clientFile, { encoding: 'utf8' }); + if (!clientText.includes('Translators: please translate this only when')) { + // Translation not ready if this key is not present. + continue; + } langs.add(lang); namespaces.add(ns); } } assert.deepEqual(gristConfig.supportedLngs.sort(), [...langs].sort()); assert.deepEqual(gristConfig.namespaces.sort(), [...namespaces].sort()); + assert.isAbove(gristConfig.supportedLngs.length, 9); }); // Now make a uz-UZ language file, and test that it is used. From b2b41a0bf84f6f9b8089d6270c0deba19f975dfe Mon Sep 17 00:00:00 2001 From: Paul Fitzpatrick Date: Mon, 3 Apr 2023 13:29:35 -0400 Subject: [PATCH 3/6] fix log.add under electron (#478) Expose the log.add method, used in old Electron code. Without this change, using the Electron build of Grist fails if is configured for debug log output. --- app/server/lib/log.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/server/lib/log.ts b/app/server/lib/log.ts index b3f9e766..c1a1ebf9 100644 --- a/app/server/lib/log.ts +++ b/app/server/lib/log.ts @@ -53,6 +53,8 @@ const log: LogWithTimestamp = Object.assign(rawLog, { rawWarn: (msg: string, meta: ILogMeta) => origLog.call(log, 'warn', msg, meta), rawDebug: (msg: string, meta: ILogMeta) => origLog.call(log, 'debug', msg, meta), origLog, + add: rawLog.add.bind(rawLog), // Explicitly pass add method along - otherwise + // there's an odd glitch under Electron. }); /** From 600f699b81b210f9c5b2fbe8b0a9ec360206fbc3 Mon Sep 17 00:00:00 2001 From: Paul Fitzpatrick Date: Mon, 3 Apr 2023 14:36:59 -0400 Subject: [PATCH 4/6] v1.0.9 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index dce8eb2d..9c08c89d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "grist-core", - "version": "1.0.8", + "version": "1.0.9", "license": "Apache-2.0", "description": "Grist is the evolution of spreadsheets", "homepage": "https://github.com/gristlabs/grist-core", From 903c81d34898e54cdc04877ac4cd660565e3728a Mon Sep 17 00:00:00 2001 From: Paul Fitzpatrick Date: Tue, 4 Apr 2023 15:59:26 -0400 Subject: [PATCH 5/6] close db after checkAllegedGristDoc (#482) This closes a file left open during importing, not by the import itself, but by a SQLite integrity check. This was causing imports to fail on Windows (see https://github.com/gristlabs/grist-electron/issues/3) --- app/server/lib/serverUtils.ts | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/app/server/lib/serverUtils.ts b/app/server/lib/serverUtils.ts index b234fd2a..7c50d747 100644 --- a/app/server/lib/serverUtils.ts +++ b/app/server/lib/serverUtils.ts @@ -136,12 +136,16 @@ export function getDatabaseUrl(options: ConnectionOptions, includeCredentials: b */ export async function checkAllegedGristDoc(docSession: OptDocSession, fname: string) { const db = await SQLiteDB.openDBRaw(fname, OpenMode.OPEN_READONLY); - const integrityCheckResults = await db.all('PRAGMA integrity_check'); - if (integrityCheckResults.length !== 1 || integrityCheckResults[0].integrity_check !== 'ok') { - const uuid = uuidv4(); - log.info('Integrity check failure on import', {uuid, integrityCheckResults, - ...getLogMetaFromDocSession(docSession)}); - throw new Error(`Document failed integrity checks - is it corrupted? Event ID: ${uuid}`); + try { + const integrityCheckResults = await db.all('PRAGMA integrity_check'); + if (integrityCheckResults.length !== 1 || integrityCheckResults[0].integrity_check !== 'ok') { + const uuid = uuidv4(); + log.info('Integrity check failure on import', {uuid, integrityCheckResults, + ...getLogMetaFromDocSession(docSession)}); + throw new Error(`Document failed integrity checks - is it corrupted? Event ID: ${uuid}`); + } + } finally { + await db.close(); } } From 0b78245194e1629305c854f7c29158f98ae8e5bb Mon Sep 17 00:00:00 2001 From: jarek Date: Wed, 5 Apr 2023 10:33:38 +0000 Subject: [PATCH 6/6] Translated using Weblate (Polish) Currently translated at 98.8% (762 of 771 strings) Translation: Grist/client Translate-URL: https://hosted.weblate.org/projects/grist/client/pl/ --- static/locales/pl.client.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static/locales/pl.client.json b/static/locales/pl.client.json index ff24d76f..6561e9c6 100644 --- a/static/locales/pl.client.json +++ b/static/locales/pl.client.json @@ -767,7 +767,7 @@ "TypeTransform": { "Cancel": "Anuluj", "Preview": "Podgląd", - "Revise": "Zrewidować", + "Revise": "Popraw", "Apply": "Zastosuj", "Update formula (Shift+Enter)": "Aktualizuj formułę (Shift+Enter)" },