No description
Find a file
Virgil bd5e299575
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
chore(i18n): verify RFC parity
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-03 07:28:40 +00:00
.core chore: add .core/ build and release configs 2026-03-06 18:52:36 +00:00
.forgejo/workflows ci: add Forgejo Actions test and security scan workflows 2026-02-23 03:28:02 +00:00
docs feat(i18n): add service state snapshot aliases 2026-04-02 12:48:49 +00:00
integration feat: upgrade to core v0.8.0-alpha.1, replace banned stdlib imports 2026-03-30 05:35:51 +00:00
locales feat(i18n): localize failure prefix 2026-04-02 08:23:19 +00:00
reversal refactor(reversal): name signal fallback lists 2026-04-02 14:39:55 +00:00
.editorconfig chore: add Go repo norms (badges, contributing, lint, taskfile, editorconfig) 2026-02-23 06:45:39 +00:00
.gitignore chore(repo): add local workflow targets 2026-04-02 14:48:13 +00:00
.golangci.yml chore: add Go repo norms (badges, contributing, lint, taskfile, editorconfig) 2026-02-23 06:45:39 +00:00
calibrate.go feat: upgrade to core v0.8.0-alpha.1, replace banned stdlib imports 2026-03-30 05:35:51 +00:00
calibrate_test.go feat(calibrate): 1B vs 27B domain calibration tool 2026-02-20 13:51:11 +00:00
classify.go feat: upgrade to core v0.8.0-alpha.1, replace banned stdlib imports 2026-03-30 05:35:51 +00:00
classify_test.go feat: upgrade to core v0.8.0-alpha.1, replace banned stdlib imports 2026-03-30 05:35:51 +00:00
CLAUDE.md chore: migrate to dappco.re vanity import path 2026-03-21 23:49:15 +00:00
compose.go feat(i18n): localise count string helpers 2026-04-02 08:12:33 +00:00
compose_test.go feat(i18n): localise count string helpers 2026-04-02 08:12:33 +00:00
context.go feat(i18n): localise count string helpers 2026-04-02 08:12:33 +00:00
context_map.go feat(i18n): add count support to translation context 2026-04-02 07:59:58 +00:00
context_test.go feat(i18n): localise count string helpers 2026-04-02 08:12:33 +00:00
CONTRIBUTING.md chore: add Go repo norms (badges, contributing, lint, taskfile, editorconfig) 2026-02-23 06:45:39 +00:00
core_service.go feat(core-service): satisfy core lifecycle contract 2026-04-03 07:16:16 +00:00
core_service_test.go feat(core-service): satisfy core lifecycle contract 2026-04-03 07:16:16 +00:00
debug.go fix(i18n): make service nil-safe 2026-04-02 14:02:13 +00:00
debug_test.go fix(i18n): preserve translate ok in debug mode 2026-04-02 06:39:39 +00:00
default_service.go refactor(i18n): centralize default-service wrappers 2026-04-02 09:52:50 +00:00
go.mod feat: upgrade to core v0.8.0-alpha.1, replace banned stdlib imports 2026-03-30 05:35:51 +00:00
go.sum feat(reversal): add negation disambiguation signal 2026-04-02 00:53:16 +00:00
grammar.go fix(i18n): add explicit article token aliases 2026-04-03 07:24:40 +00:00
grammar_test.go fix(i18n): add explicit article token aliases 2026-04-03 07:24:40 +00:00
handler.go refactor(i18n): use count helper for singular fallback 2026-04-02 11:21:03 +00:00
handler_test.go fix(i18n): honor default translation context count 2026-04-02 13:41:48 +00:00
hooks.go fix(i18n): append missing-key handlers 2026-04-02 14:36:14 +00:00
hooks_test.go fix(i18n): append missing-key handlers 2026-04-02 14:36:14 +00:00
i18n.go refactor(i18n): delegate prompt and lang wrappers 2026-04-03 07:12:34 +00:00
i18n_test.go fix(i18n): preserve translate result status 2026-04-02 13:46:25 +00:00
language.go fix(i18n): align plural fallback with base tags 2026-04-02 09:33:21 +00:00
language_test.go fix(i18n): align plural fallback with base tags 2026-04-02 09:33:21 +00:00
loader.go fix(i18n): broaden locale filename resolution 2026-04-02 14:52:39 +00:00
loader_test.go fix(i18n): broaden locale filename resolution 2026-04-02 14:52:39 +00:00
localise.go feat(i18n): add current text direction aliases 2026-04-02 12:10:30 +00:00
localise_test.go feat(i18n): add current text direction aliases 2026-04-02 12:10:30 +00:00
Makefile chore(repo): add local workflow targets 2026-04-02 14:48:13 +00:00
numbers.go fix(i18n): handle min int formatting edge case 2026-04-03 07:19:53 +00:00
numbers_test.go fix(i18n): handle min int formatting edge case 2026-04-03 07:19:53 +00:00
README.md chore(repo): add local workflow targets 2026-04-02 14:48:13 +00:00
REVIEW.md review: post-implementation findings for dual-class disambiguation 2026-02-19 16:50:18 +00:00
service.go refactor(i18n): delegate prompt and lang wrappers 2026-04-03 07:12:34 +00:00
service_test.go refactor(i18n): add service snapshot stringers 2026-04-02 14:30:28 +00:00
state.go refactor(i18n): add service snapshot stringers 2026-04-02 14:30:28 +00:00
time.go feat(time): use locale word fallback for relative time 2026-04-02 08:41:07 +00:00
time_test.go feat(time): use locale word fallback for relative time 2026-04-02 08:41:07 +00:00
transform.go fix(i18n): honor default translation context count 2026-04-02 13:41:48 +00:00
transform_test.go fix(i18n): honor default translation context count 2026-04-02 13:41:48 +00:00
types.go feat(reversal): expand dual-class vocabulary 2026-04-02 04:16:00 +00:00
types_test.go feat: grammar-aware i18n module extracted from core 2026-02-16 19:51:27 +00:00
validate.go feat(validate): expand french article prompt 2026-04-02 00:09:59 +00:00
validate_test.go feat(validate): expand french article prompt 2026-04-02 00:09:59 +00:00

Go Reference License: EUPL-1.2 Go Version

go-i18n

Grammar engine for Go. Provides forward composition primitives (PastTense, Gerund, Pluralize, Article, composite progress and label functions), a T() translation entry point with namespace key handlers, and a reversal engine that recovers base forms and grammatical roles from inflected text. The reversal package produces GrammarImprint feature vectors for semantic similarity scoring, builds reference domain distributions, performs anomaly detection, and includes a 1B model pre-sort pipeline for training data classification. Consumers bring their own translation keys; this library provides the grammatical machinery.

Module: dappco.re/go/core/i18n Licence: EUPL-1.2 Language: Go 1.25

Quick Start

import "dappco.re/go/core/i18n"

// Grammar primitives
fmt.Println(i18n.PastTense("delete"))   // "deleted"
fmt.Println(i18n.Gerund("build"))       // "building"
fmt.Println(i18n.Pluralize("file", 3))  // "files"

// Translation with auto-composed output
fmt.Println(i18n.T("i18n.progress.build"))  // "Building..."
fmt.Println(i18n.T("i18n.done.delete", "file"))  // "File deleted"

// Reversal: recover grammar from text
tokeniser := reversal.NewTokeniser()
tokens := tokeniser.Tokenise("deleted the files")
imprint := reversal.NewImprint(tokens)

Documentation

  • Architecture — grammar primitives, T() handlers, reversal engine, GrammarImprint, reference distributions, 1B pipeline
  • Development Guide — building, testing, grammar table structure (critical: do not flatten JSON)
  • Project History — completed phases and known limitations

Build & Test

go test ./...
go test -v ./reversal/
go test -bench=. ./...
go build ./...

For repeatable local runs in a clean workspace, the repo also ships a Makefile with the standard workflow targets:

make build
make vet
make test
make cover
make tidy

Licence

European Union Public Licence 1.2 — see LICENCE for details.