144 files moved with git mv (pure renames). Root package.json delegates dev/typecheck/test:run/lint/build to the packages; Node 24 LTS and pnpm 10.13.1 pinned (.nvmrc, .node-version, engines, packageManager, root devDependency, engine-strict). Dockerfile builds @faunosteo/app on node:24-alpine and copies apps/app/dist; nginx and runtime config unchanged. CI workflow for Gitea Actions. packages/ reserved (README only). Docs synced: WORKSPACE.md, CLAUDE.md, README, DEPLOY, CHANGELOG, plan. 271/271 tests, typecheck, lint, build green from the root.
18 lines
455 B
TypeScript
18 lines
455 B
TypeScript
import { useLocaleStore } from '@/state/localeStore'
|
|
import { getDict } from './index'
|
|
|
|
export function useT(): (key: string) => string {
|
|
const locale = useLocaleStore((s) => s.locale)
|
|
const dict = getDict(locale)
|
|
return (key: string) => {
|
|
const v = dict[key]
|
|
if (v === undefined) {
|
|
if (import.meta.env?.DEV) {
|
|
console.warn(`i18n: missing key "${key}" for locale "${locale}"`)
|
|
}
|
|
return key
|
|
}
|
|
return v
|
|
}
|
|
}
|