localization for ntfy and mail

This commit is contained in:
MDeeApp
2025-10-11 19:34:54 +02:00
parent 17e094e8ac
commit adc4cfbee8
25 changed files with 609 additions and 74 deletions

View File

@@ -4,6 +4,7 @@ import { dirname, resolve } from "node:path";
import { config } from "./config.js";
import { createLogger } from "./logger.js";
import { DEFAULT_CATEGORY_NAMES } from "./categoryDefaults.js";
const logger = createLogger(config.logLevel);
@@ -52,21 +53,11 @@ CREATE TABLE IF NOT EXISTS categories (
`);
const defaultCategories = [
"Versicherung",
"Strom & Energie",
"Internet & Telefon",
"Miete & Wohnen",
"Mobilfunk",
"Streaming & Medien",
"Wartung & Service"
];
const categoryRow = db.prepare(`SELECT COUNT(*) as count FROM categories`).get() as { count: number } | undefined;
const categoryCount = categoryRow?.count ?? 0;
if (categoryCount === 0) {
const insertStmt = db.prepare(`INSERT OR IGNORE INTO categories (name) VALUES (?)`);
for (const name of defaultCategories) {
for (const name of DEFAULT_CATEGORY_NAMES) {
insertStmt.run(name);
}
}