Implements Phases 1-8 of the TFTSR implementation plan. Rust backend (Tauri 2.x, src-tauri/): - Multi-provider AI: OpenAI-compatible, Anthropic, Gemini, Mistral, Ollama - PII detection engine: 11 regex patterns with overlap resolution - SQLCipher AES-256 encrypted database with 10 versioned migrations - 28 Tauri IPC commands for triage, analysis, document, and system ops - Ollama: hardware probe, model recommendations, pull/delete with events - RCA and blameless post-mortem Markdown document generators - PDF export via printpdf - Audit log: SHA-256 hash of every external data send - Integration stubs for Confluence, ServiceNow, Azure DevOps (v0.2) Frontend (React 18 + TypeScript + Vite, src/): - 9 pages: full triage workflow NewIssue→LogUpload→Triage→Resolution→RCA→Postmortem→History+Settings - 7 components: ChatWindow, TriageProgress, PiiDiffViewer, DocEditor, HardwareReport, ModelSelector, UI primitives - 3 Zustand stores: session, settings (persisted), history - Type-safe tauriCommands.ts matching Rust backend types exactly - 8 IT domain system prompts (Linux, Windows, Network, K8s, DB, Virt, HW, Obs) DevOps: - .woodpecker/test.yml: rustfmt, clippy, cargo test, tsc, vitest on every push - .woodpecker/release.yml: linux/amd64 + linux/arm64 builds, Gogs release upload Verified: - cargo check: zero errors - tsc --noEmit: zero errors - vitest run: 13/13 unit tests passing Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| build | ||
| CHANGELOG.md | ||
| index.mjs | ||
| LICENSE | ||
| package.json | ||
| README.md | ||
y18n
The bare-bones internationalization library used by yargs.
Inspired by i18n.
Examples
simple string translation:
const __ = require('y18n')().__;
console.log(__('my awesome string %s', 'foo'));
output:
my awesome string foo
using tagged template literals
const __ = require('y18n')().__;
const str = 'foo';
console.log(__`my awesome string ${str}`);
output:
my awesome string foo
pluralization support:
const __n = require('y18n')().__n;
console.log(__n('one fish %s', '%d fishes %s', 2, 'foo'));
output:
2 fishes foo
Deno Example
As of v5 y18n supports Deno:
import y18n from "https://deno.land/x/y18n/deno.ts";
const __ = y18n({
locale: 'pirate',
directory: './test/locales'
}).__
console.info(__`Hi, ${'Ben'} ${'Coe'}!`)
You will need to run with --allow-read to load alternative locales.
JSON Language Files
The JSON language files should be stored in a ./locales folder.
File names correspond to locales, e.g., en.json, pirate.json.
When strings are observed for the first time they will be added to the JSON file corresponding to the current locale.
Methods
require('y18n')(config)
Create an instance of y18n with the config provided, options include:
directory: the locale directory, default./locales.updateFiles: should newly observed strings be updated in file, defaulttrue.locale: what locale should be used.fallbackToLanguage: should fallback to a language-only file (e.g.en.json) be allowed if a file matching the locale does not exist (e.g.en_US.json), defaulttrue.
y18n.__(str, arg, arg, arg)
Print a localized string, %s will be replaced with args.
This function can also be used as a tag for a template literal. You can use it
like this: __`hello ${'world'}`. This will be equivalent to
__('hello %s', 'world').
y18n.__n(singularString, pluralString, count, arg, arg, arg)
Print a localized string with appropriate pluralization. If %d is provided
in the string, the count will replace this placeholder.
y18n.setLocale(str)
Set the current locale being used.
y18n.getLocale()
What locale is currently being used?
y18n.updateLocale(obj)
Update the current locale with the key value pairs in obj.
Supported Node.js Versions
Libraries in this ecosystem make a best effort to track Node.js' release schedule. Here's a post on why we think this is important.
License
ISC