Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 19 additions & 4 deletions TRANSLATIONS.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,42 @@
# Translation Status

Last updated: 2026-03-31 10:04:24
Last updated: 2026-10-01 08:50:49

Reference locale (en): **345 keys**
Reference locale (en): **332 keys**

## Overview

| Locale | File | Missing | Additional | Status |
|--------|------|---------|------------|--------|
| pt-br | pt-br.json | 0 | 0 | ✅ |
| tr | tr.json | 0 | 0 | ✅ |
| es-co | es-co.json | 0 | 0 | ✅ |
| nl | nl.json | 0 | 0 | ✅ |
| pt-br | pt-br.json | 0 | 0 | ✅ |
| es-ar | es-ar.json | 0 | 0 | ✅ |
| de | de.json | 0 | 0 | ✅ |

## Details

### pt-br (pt-br.json)
### tr (tr.json)

✅ All translations complete

### es-co (es-co.json)

✅ All translations complete

### nl (nl.json)

✅ All translations complete

### pt-br (pt-br.json)

✅ All translations complete

### es-ar (es-ar.json)

✅ All translations complete

### de (de.json)

✅ All translations complete
Expand Down
21 changes: 11 additions & 10 deletions frontend/extract-i18n-keys.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@
* all used keys exist in your translation files.
*/

const fs = require("fs");
const path = require("path");
import fs from "fs";
import path from "path";
import { fileURLToPath } from "url";

const __dirname = path.dirname(fileURLToPath(import.meta.url));

const SRC_DIR = path.join(__dirname, "src");
const LOCALES_DIR = path.join(__dirname, "src/lib/i18n/locales");
const SOURCE_FILE = "en.json";

// Regex patterns to match translation calls
const T_PATTERNS = [
/\bt\(['"`]([^'"`]+)['"`]\)/g, // t("key") or t('key')
/\$t\(['"`]([^'"`]+)['"`]\)/g, // $t("key") - Svelte store syntax
/\{\s*t\(['"`]([^'"`]+)['"`]\)\s*\}/g, // { t("key") } - in templates
];
// Matches t("key"), t('key'), $t("key"), t("key", { params }) and tKey("key").
// tKey() marks keys that are defined in one place and passed to t() later.
const T_PATTERNS = [/(?<![\w.])(?:\$?t|tKey)\(\s*(["'`])((?:\\.|(?!\1)[^\\])*)\1\s*[,)]/gs];

function findFiles(dir, extensions = [".svelte", ".ts", ".js"]) {
let results = [];
Expand Down Expand Up @@ -50,7 +50,8 @@ function extractKeysFromFile(filePath) {
for (const pattern of T_PATTERNS) {
let match;
while ((match = pattern.exec(content)) !== null) {
keys.add(match[1]);
if (match[1] === "`" && match[2].includes("${")) continue;
keys.add(match[1] === "`" ? match[2] : JSON.parse(`"${match[2].replace(/\\'/g, "'")}"`));
}
}

Expand Down Expand Up @@ -188,7 +189,7 @@ function extractAndSync() {
console.log("\n✨ All translation files updated!");
if (missingKeys.length > 0) {
console.log(
'\n💡 Tip: Search for "[NEEDS TRANSLATION]" in de.json, nl.json, and pt-br.json',
'\n💡 Tip: Search for "[NEEDS TRANSLATION]" in the non-English locale files',
);
}
} else {
Expand Down
22 changes: 12 additions & 10 deletions frontend/src/lib/components/Breadcrumbs.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<script lang="ts">
import { page } from "$app/state";
import { tKey } from "$lib/i18n/mod";

interface Props {
t: (key: string, params?: Record<string, string | number>) => string;
Expand All @@ -15,16 +16,17 @@
}

const LABEL_MAP: Record<string, string> = {
dashboard: "Dashboard",
invoices: "Invoices",
products: "Products",
customers: "Customers",
templates: "Templates",
settings: "Settings",
new: "New",
edit: "Edit",
html: "HTML",
pdf: "PDF",
dashboard: tKey("Dashboard"),
invoices: tKey("Invoices"),
products: tKey("Products"),
customers: tKey("Customers"),
users: tKey("Users"),
templates: tKey("Templates"),
settings: tKey("Settings"),
new: tKey("New"),
edit: tKey("Edit"),
html: tKey("HTML"),
pdf: tKey("PDF"),
};

let segments = $derived(
Expand Down
Loading
Loading