diff --git a/app/client/components/GristDoc.ts b/app/client/components/GristDoc.ts index 3b344100..589888bb 100644 --- a/app/client/components/GristDoc.ts +++ b/app/client/components/GristDoc.ts @@ -1336,7 +1336,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 @@ -1370,7 +1370,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/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. }); /** 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(); } } 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", 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" 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)" }, 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.