Commit graph

32 commits

Author SHA1 Message Date
Virgil
06a5fe9ac8 feat(core-service): satisfy core lifecycle contract
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-03 07:16:16 +00:00
Virgil
0cea872363 refactor(i18n): add service option stringers
Some checks failed
Security Scan / security (push) Successful in 14s
Test / test (push) Has been cancelled
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-02 14:33:27 +00:00
Virgil
0c26ef0caa refactor(i18n): add service snapshot stringers
Some checks are pending
Test / test (push) Waiting to run
Security Scan / security (push) Successful in 21s
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-02 14:30:28 +00:00
Virgil
5dc9847eec refactor(i18n): centralise default state snapshot
All checks were successful
Security Scan / security (push) Successful in 15s
Test / test (push) Successful in 2m24s
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-02 13:20:34 +00:00
Virgil
6e202e8230 fix(i18n): copy missing-key snapshots safely
All checks were successful
Security Scan / security (push) Successful in 18s
Test / test (push) Successful in 2m31s
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-02 13:13:49 +00:00
Virgil
82164940d7 refactor(core): make core service nil-safe
All checks were successful
Security Scan / security (push) Successful in 10s
Test / test (push) Successful in 2m23s
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-02 13:09:54 +00:00
Virgil
9d4af96d3d feat(i18n): add service state snapshot aliases
Some checks failed
Security Scan / security (push) Successful in 18s
Test / test (push) Has been cancelled
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-02 12:48:49 +00:00
Virgil
24eaadda8a feat(i18n): add current prompt alias
All checks were successful
Security Scan / security (push) Successful in 14s
Test / test (push) Successful in 2m29s
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-02 12:31:00 +00:00
Virgil
e1f496f296 feat(i18n): add service prompt and language helpers
All checks were successful
Security Scan / security (push) Successful in 14s
Test / test (push) Successful in 2m29s
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-02 12:27:21 +00:00
Virgil
1ae9ada1fd feat(i18n): add current text direction aliases
All checks were successful
Security Scan / security (push) Successful in 14s
Test / test (push) Successful in 2m27s
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-02 12:10:30 +00:00
Virgil
849428ab10 feat(i18n): add plural category alias symmetry
All checks were successful
Security Scan / security (push) Successful in 14s
Test / test (push) Successful in 2m22s
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-02 11:52:32 +00:00
Virgil
8551af74be feat(i18n): add current language alias
All checks were successful
Security Scan / security (push) Successful in 22s
Test / test (push) Successful in 2m27s
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-02 11:48:29 +00:00
Virgil
e9f06342a7 feat(i18n): add rtl aliases and definite article template func
All checks were successful
Security Scan / security (push) Successful in 13s
Test / test (push) Successful in 2m23s
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-02 11:37:33 +00:00
Virgil
7f09ee550f feat(i18n): add current RTL and handler aliases
Some checks are pending
Test / test (push) Waiting to run
Security Scan / security (push) Successful in 19s
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-02 11:26:14 +00:00
Virgil
520a5188ba feat(i18n): add core plural category alias
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-02 10:41:08 +00:00
Virgil
2e4a6e5e11 refactor(i18n): add core service current-state aliases
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-02 10:38:34 +00:00
Virgil
2195d42413 feat(i18n): add message helper wrappers
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-02 10:29:18 +00:00
Virgil
1af9f42be3 feat(i18n): add core service handler delegates
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-02 10:26:05 +00:00
Virgil
149bed3698 feat(i18n): expose core service delegates
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-02 10:23:19 +00:00
Virgil
174d78b37d feat(i18n): extend core service options
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-02 10:09:24 +00:00
Virgil
9a846ae05b fix(i18n): preserve core language errors
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-02 08:19:51 +00:00
Virgil
e934c4f02c refactor(i18n): remove missing-key handler wrapper
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-02 07:50:12 +00:00
Virgil
0baf2d3e7f fix(i18n): preserve missing-key hooks in core service
Some checks are pending
Test / test (push) Waiting to run
Security Scan / security (push) Successful in 11s
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-02 02:07:11 +00:00
Virgil
07d22a2bd6 fix(i18n): load registered locales in core bootstrap
Some checks failed
Security Scan / security (push) Successful in 13s
Test / test (push) Has been cancelled
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-02 00:44:12 +00:00
Claude
c4ef1e6205 feat: upgrade to core v0.8.0-alpha.1, replace banned stdlib imports
All checks were successful
Security Scan / security (push) Successful in 8s
Test / test (push) Successful in 49s
Replace fmt, errors, strings, encoding/json with Core primitives
across 20 files. Keep strings.Fields/CutPrefix. No translation
files modified.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 05:35:51 +00:00
Snider
7e602ed48a fix(coderabbit): address review findings
1. core_service.go: Return error when SetLanguage fails instead of
   silently discarding it.
2. grammar.go/service.go: Add MergeGrammarData() and use it in AddLoader
   and loadJSON so multiple loaders merge grammar entries instead of
   replacing the entire struct per language.
3. service.go: Document that package-level AddLoader is superseded when
   NewCoreService replaces the default — by design, not a bug.
4. service.go: Use CompareAndSwap in Init() to prevent TOCTOU race where
   a concurrent SetDefault could be overwritten.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-30 05:35:49 +00:00
Snider
5bc988ecf9 refactor: migrate core import to dappco.re/go/core
Some checks failed
Security Scan / security (push) Successful in 16s
Test / test (push) Failing after 30s
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-21 19:59:39 +00:00
Snider
aa5d739f9d fix(dx): migrate error handling to log.E(), fix build, add tests
All checks were successful
Security Scan / security (pull_request) Successful in 7s
Test / test (pull_request) Successful in 1m24s
- Replace all fmt.Errorf/errors.New with log.E() from go-log
- Fix core_service.go build error (c.Locales() does not exist on Core)
- Add tests for Service.AddLoader, LoadFS, LanguagesErr, flatten, IsRTL
- Document error handling convention in CLAUDE.md
- Coverage: 85.2% root, 91.0% reversal (up from 83.1%)

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-17 07:51:29 +00:00
Snider
7968811d56 refactor: use AddLoader for all locale sources in CoreService
Some checks failed
Security Scan / security (push) Successful in 9s
Test / test (push) Failing after 27s
ExtraFS and Core.Locales() both go through AddLoader now for proper
grammar handling. Package-level T() not resolving — needs debug.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-17 01:45:39 +00:00
Snider
a8217d1ebf feat: CoreService auto-loads locales from Core.Locales()
Some checks failed
Security Scan / security (push) Successful in 8s
Test / test (push) Failing after 32s
i18n service now loads translations from three sources:
1. Embedded go-i18n base (grammar, verbs, nouns)
2. ExtraFS from ServiceOptions
3. Core.Locales() — collected from services implementing LocaleProvider

Services just implement Locales() fs.FS and translations load automatically.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-17 01:31:32 +00:00
Snider
90566d9460 feat: add ExtraFS to ServiceOptions for loading additional translations
All checks were successful
Security Scan / security (push) Successful in 9s
Test / test (push) Successful in 44s
ServiceOptions.ExtraFS accepts []FSSource — each pairs an fs.FS with
a directory path. Translations load on top of the embedded defaults.
Enables consuming packages to ship their own locale files.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-17 00:28:40 +00:00
Snider
08f60e3ebb feat: add CoreService for Core framework integration
All checks were successful
Security Scan / security (push) Successful in 9s
Test / test (push) Successful in 1m21s
NewCoreService() creates an i18n Core service factory so any binary
can register i18n without depending on core/cli.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-16 16:24:00 +00:00