From f8e532fbf5911053331f87964657fd207003af3d Mon Sep 17 00:00:00 2001 From: hugo Date: Sat, 21 Feb 2026 13:38:01 +0100 Subject: [PATCH] chore: i18n the last - hopefully --- eslint.config.mjs | 11 +++++++++-- package.json | 6 +++--- .../components/MilkdownEditor/MilkdownEditor.tsx | 2 -- src/renderer/components/StatusBar/StatusBar.tsx | 2 +- src/renderer/i18n/locales/de.json | 1 + src/renderer/i18n/locales/en.json | 1 + src/renderer/i18n/locales/es.json | 1 + src/renderer/i18n/locales/fr.json | 1 + src/renderer/i18n/locales/it.json | 1 + 9 files changed, 18 insertions(+), 8 deletions(-) diff --git a/eslint.config.mjs b/eslint.config.mjs index ca324c1..ea12140 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -28,8 +28,8 @@ export default [ i18next, }, rules: { - 'i18next/no-literal-string': ['warn', { - mode: 'jsx-only', + 'i18next/no-literal-string': ['error', { + mode: 'jsx-text-only', 'jsx-components': { exclude: ['Trans'], }, @@ -83,6 +83,13 @@ export default [ '[0-9!-/:-@[-`{-~]+', '[A-Z_-]+', /^\p{Emoji}+$/u, + /^[\s\p{Emoji}\uFE0F]+$/u, + /^[\s0-9%—()\-+.]+$/, + /^[\s+ו○●⊘→←↶↷―✕✖✔❝]+$/, + /^H[1-6]$/, + /^(DB\s*→\s*File|File\s*→\s*DB)$/, + /^\/posts\/$/, + 'bDS', '[✓✗▼▶◀▲]+' ], }, diff --git a/package.json b/package.json index f5357c0..29560b0 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "dev:electron": "wait-on http://localhost:5173 && cross-env NODE_ENV=development node ./node_modules/electron/cli.js .", "start": "concurrently --kill-others \"npm run dev:renderer\" \"npm run start:electron\"", "start:electron": "wait-on http://localhost:5173 && cross-env NODE_ENV=development node ./node_modules/electron/cli.js .", - "build": "npm run db:generate && npm run build:main && npm run build:renderer", + "build": "npm run lint && npm run db:generate && npm run build:main && npm run build:renderer", "build:main": "node ./node_modules/typescript/bin/tsc -p tsconfig.main.json", "build:renderer": "node ./node_modules/vite/bin/vite.js build", "start:prod": "node ./node_modules/electron/cli.js .", @@ -20,8 +20,8 @@ "test:watch": "vitest", "test:coverage": "vitest run --coverage", "test:ui": "vitest --ui", - "lint": "eslint \"src/renderer/**/*.{ts,tsx}\"", - "lint:i18n": "eslint \"src/renderer/**/*.{ts,tsx}\" --rule \"i18next/no-literal-string: warn\"", + "lint": "eslint \"src/renderer/**/*.{ts,tsx}\" --max-warnings 0", + "lint:i18n": "eslint \"src/renderer/**/*.{ts,tsx}\" --max-warnings 0", "db:generate": "node ./node_modules/drizzle-kit/bin.cjs generate", "db:migrate": "node ./node_modules/tsx/dist/cli.mjs src/main/database/migrate.ts", "db:studio": "node ./node_modules/drizzle-kit/bin.cjs studio" diff --git a/src/renderer/components/MilkdownEditor/MilkdownEditor.tsx b/src/renderer/components/MilkdownEditor/MilkdownEditor.tsx index e64215c..2caec2d 100644 --- a/src/renderer/components/MilkdownEditor/MilkdownEditor.tsx +++ b/src/renderer/components/MilkdownEditor/MilkdownEditor.tsx @@ -95,8 +95,6 @@ const EditorToolbar: React.FC = ({ onUserInteraction }) => { const [insertMode, setInsertMode] = useState(null); const [selectedText, setSelectedText] = useState(''); - // eslint-disable-next-line @typescript-eslint/no-explicit-any - // eslint-disable-next-line @typescript-eslint/no-explicit-any const runCommand = useCallback((commandKey: any, payload?: unknown) => { if (loading) return; const editor = getEditor(); diff --git a/src/renderer/components/StatusBar/StatusBar.tsx b/src/renderer/components/StatusBar/StatusBar.tsx index 66f301a..8fd4ca6 100644 --- a/src/renderer/components/StatusBar/StatusBar.tsx +++ b/src/renderer/components/StatusBar/StatusBar.tsx @@ -51,7 +51,7 @@ export const StatusBar: React.FC = () => { {runningTasks[0].message} {runningTasks.length > 1 && ( - +{runningTasks.length - 1} more + {t('statusBar.more', { count: runningTasks.length - 1 })} )} )} diff --git a/src/renderer/i18n/locales/de.json b/src/renderer/i18n/locales/de.json index 4a03d67..0c75f54 100644 --- a/src/renderer/i18n/locales/de.json +++ b/src/renderer/i18n/locales/de.json @@ -698,6 +698,7 @@ "postSearch.hint": "Mit ↑↓ navigieren, Enter auswählen, Esc schließen", "statusBar.posts": "{count} Beiträge", "statusBar.media": "{count} Medien", + "statusBar.more": "+{count} weitere", "statusBar.theme": "Theme: {theme}", "statusBar.ui": "UI", "statusBar.uiLanguage": "UI-Sprache", diff --git a/src/renderer/i18n/locales/en.json b/src/renderer/i18n/locales/en.json index f8206c1..ff0e6d0 100644 --- a/src/renderer/i18n/locales/en.json +++ b/src/renderer/i18n/locales/en.json @@ -698,6 +698,7 @@ "postSearch.hint": "Use ↑↓ to navigate, Enter to select, Esc to close", "statusBar.posts": "{count} posts", "statusBar.media": "{count} media", + "statusBar.more": "+{count} more", "statusBar.theme": "Theme: {theme}", "statusBar.ui": "UI", "statusBar.uiLanguage": "UI language", diff --git a/src/renderer/i18n/locales/es.json b/src/renderer/i18n/locales/es.json index 511245b..9077f71 100644 --- a/src/renderer/i18n/locales/es.json +++ b/src/renderer/i18n/locales/es.json @@ -698,6 +698,7 @@ "postSearch.hint": "Busca por título, slug o contenido", "statusBar.posts": "Publicaciones", "statusBar.media": "Medios", + "statusBar.more": "+{count} más", "statusBar.theme": "Tema: {theme}", "statusBar.ui": "UI", "statusBar.uiLanguage": "Idioma de la interfaz", diff --git a/src/renderer/i18n/locales/fr.json b/src/renderer/i18n/locales/fr.json index f459560..c96e3a3 100644 --- a/src/renderer/i18n/locales/fr.json +++ b/src/renderer/i18n/locales/fr.json @@ -698,6 +698,7 @@ "postSearch.hint": "Rechercher par titre, slug ou contenu", "statusBar.posts": "Articles", "statusBar.media": "Médias", + "statusBar.more": "+{count} en plus", "statusBar.theme": "Thème : {theme}", "statusBar.ui": "UI", "statusBar.uiLanguage": "Langue de l’interface", diff --git a/src/renderer/i18n/locales/it.json b/src/renderer/i18n/locales/it.json index 31aed49..62eb70a 100644 --- a/src/renderer/i18n/locales/it.json +++ b/src/renderer/i18n/locales/it.json @@ -698,6 +698,7 @@ "postSearch.hint": "Cerca per titolo, slug o contenuto", "statusBar.posts": "Articoli", "statusBar.media": "Media", + "statusBar.more": "+{count} in più", "statusBar.theme": "Tema: {theme}", "statusBar.ui": "UI", "statusBar.uiLanguage": "Lingua interfaccia",