refactor(cli): integrate i18n support across commands

- Centralize CLI text strings using the i18n module for localization
- Refactor `createCommand` and `createCli` to improve modularity
- Update logging and error messages to use translated strings
This commit is contained in:
2025-05-28 18:09:52 +02:00
parent 8efbee1ba9
commit 2a13ee2539
6 changed files with 73 additions and 61 deletions

View File

@@ -1,6 +1,7 @@
import { ensureDir, exists } from 'https://deno.land/std@0.224.0/fs/mod.ts';
import { join } from 'https://deno.land/std@0.224.0/path/mod.ts';
import { TimerOptions } from '../types/mod.ts';
import { t } from '../i18n/mod.ts';
export async function writeUnitFiles(
name: string,
@@ -28,9 +29,9 @@ export async function writeUnitFiles(
await Deno.remove(timerPath);
}
} catch (rollbackError) {
console.error('Rollback fehlgeschlagen:', rollbackError);
console.error(t('rollback_failed'), rollbackError);
}
console.error('Fehler beim Schreiben der Units:', error);
console.error(t('error_write_units'), error);
return undefined;
}