From 85ec882950d4c4bc7b67dd47023390a471964f95 Mon Sep 17 00:00:00 2001 From: James Brunton Date: Fri, 31 Oct 2025 14:38:03 +0000 Subject: [PATCH 1/2] Improve diff for missing translations test (#4790) # Description of Changes Improve diff for missing translations test --- .../core/tests/missingTranslations.test.ts | 33 ++++++++++++++----- 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/frontend/src/core/tests/missingTranslations.test.ts b/frontend/src/core/tests/missingTranslations.test.ts index 2991ecaad..e7d7ef1b3 100644 --- a/frontend/src/core/tests/missingTranslations.test.ts +++ b/frontend/src/core/tests/missingTranslations.test.ts @@ -23,6 +23,7 @@ const IGNORED_KEYS = new Set([ type FoundKey = { key: string; + fallback: string; file: string; line: number; column: number; @@ -86,22 +87,27 @@ const extractKeys = (file: string): FoundKey[] => { const found: FoundKey[] = []; - const record = (node: ts.Node, key: string) => { + const record = (node: ts.Node, key: string, fallback: string = "") => { const { line, character } = sourceFile.getLineAndCharacterOfPosition(node.getStart()); - found.push({ key, file, line: line + 1, column: character + 1 }); + found.push({ key, fallback, file, line: line + 1, column: character + 1 }); }; const visit = (node: ts.Node) => { if (ts.isCallExpression(node)) { const callee = node.expression; - const arg = node.arguments.at(0); + const arg0 = node.arguments.at(0); + const arg1 = node.arguments.at(1); const isT = (ts.isIdentifier(callee) && callee.text === 't') || (ts.isPropertyAccessExpression(callee) && callee.name.text === 't'); - if (isT && arg && (ts.isStringLiteral(arg) || ts.isNoSubstitutionTemplateLiteral(arg))) { - record(arg, arg.text); + if (isT && arg0 && (ts.isStringLiteral(arg0) || ts.isNoSubstitutionTemplateLiteral(arg0))) { + let arg1Text: string = ""; + if (arg1 && (ts.isStringLiteral(arg1) || ts.isNoSubstitutionTemplateLiteral(arg1))) { + arg1Text = arg1.text; + } + record(arg0, arg0.text, arg1Text); } } @@ -154,12 +160,13 @@ describe('Missing translation coverage', () => { const missingKeys = usedKeys.filter(({ key }) => !availableKeys.has(key)); - const annotations = missingKeys.map(({ key, file, line, column }) => { + const annotations = missingKeys.map(({ key, fallback, file, line, column }) => { const workspaceRelativeRaw = path.relative(REPO_ROOT, file); const workspaceRelativeFile = workspaceRelativeRaw.replace(/\\/g, '/'); return { key, + fallback, file: workspaceRelativeFile, line, column, @@ -167,12 +174,20 @@ describe('Missing translation coverage', () => { }); // Output errors in GitHub Annotations format so they appear tagged in the code in CI - for (const { key, file, line, column } of annotations) { + for (const { key, fallback, file, line, column } of annotations) { process.stderr.write( - `::error file=${file},line=${line},col=${column}::Missing en-GB translation for ${key}\n`, + `::error file=${file},line=${line},col=${column}::Missing en-GB translation for ${key} (${fallback})\n`, ); } - expect(missingKeys).toEqual([]); + const neatened = annotations.map(({ key, fallback, file, line, column }) => { + return { + key, + fallback, + location: `${file}:${line}:${column}`, + } + }); + + expect(neatened).toEqual([]); }); }); From bfd6610565e719125ba2fb07db1d6418920e4187 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20Sz=C3=BCcs?= <127139797+balazs-szucs@users.noreply.github.com> Date: Sun, 2 Nov 2025 17:08:25 +0100 Subject: [PATCH 2/2] [V2] fix(tooltip): adjust close button position (#4803) # Description of Changes - Updated the `top` property of `.tooltip-pin-button` from `-0.5rem` to `0.5rem` for proper alignment. ### Pictures: Before: image After: image Before: image After: image --- ## Checklist ### General - [x] I have read the [Contribution Guidelines](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/CONTRIBUTING.md) - [x] I have read the [Stirling-PDF Developer Guide](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/devGuide/DeveloperGuide.md) (if applicable) - [ ] I have read the [How to add new languages to Stirling-PDF](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/devGuide/HowToAddNewLanguage.md) (if applicable) - [x] I have performed a self-review of my own code - [x] My changes generate no new warnings ### Documentation - [ ] I have updated relevant docs on [Stirling-PDF's doc repo](https://github.com/Stirling-Tools/Stirling-Tools.github.io/blob/main/docs/) (if functionality has heavily changed) - [ ] I have read the section [Add New Translation Tags](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/devGuide/HowToAddNewLanguage.md#add-new-translation-tags) (for new translation tags only) ### UI Changes (if applicable) - [x] Screenshots or videos demonstrating the UI changes are attached (e.g., as comments or direct attachments in the PR) ### Testing (if applicable) - [x] I have tested my changes locally. Refer to the [Testing Guide](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/devGuide/DeveloperGuide.md#6-testing) for more details. --- frontend/src/core/components/shared/tooltip/Tooltip.module.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/core/components/shared/tooltip/Tooltip.module.css b/frontend/src/core/components/shared/tooltip/Tooltip.module.css index 50c242812..62c4bf696 100644 --- a/frontend/src/core/components/shared/tooltip/Tooltip.module.css +++ b/frontend/src/core/components/shared/tooltip/Tooltip.module.css @@ -33,7 +33,7 @@ /* Close button */ .tooltip-pin-button { position: absolute; - top: -0.5rem; + top: 0.5rem; right: 0.5rem; font-size: 0.875rem; background: var(--bg-raised);