compile library

stringlocale build-time API (compiler, check, prune, LLM drafters). Import this only in build scripts — not in app/runtime code.

Classes

CompileResult
Drafter
OfflineDrafter
Deterministic, no-network drafter — builds a testable bundle without a key.
OpenRouterDrafter
OpenRouter-backed drafter (synchronous via blocking HTTP through a helper). Note: Dart HTTP is async; the compiler awaits these, so this exposes async variants. The Drafter interface stays sync for the offline path; the async OpenRouter calls are used by the async compiler entry points.
PruneResult
Report

Constants

defaultModel → const String

Functions

check(List<StringLocale>? strings, String bundleDir, {List<String>? locales}) Report
compileAll({required List<String> locales, Object? drafter, String sourceLocale = 'en', bool force = false, String? existingDir, void log(String)?}) Future<CompileResult>
Sweep the global registry and compile every declared string.
compileStrings({required List<StringLocale> strings, required List<String> locales, Object? drafter, String sourceLocale = 'en', bool force = false, String? existingDir, void log(String)?}) Future<CompileResult>
Compile an explicit list. Drafters can be OfflineDrafter or OpenRouterDrafter.
parseLocaleArg(String value) String
Parse "code:Language" (or just "code") to the locale code.
prune(List<StringLocale>? strings, String bundleDir, {List<String>? locales, bool dryRun = false}) PruneResult
slHash(List<String> parts) String
Stable 16-hex hash (two 32-bit FNV-1a accumulators kept positive).