[agent/codex:gpt-5.4-mini] Read ~/spec/code/core/go/i18n/RFC.md fully. Find ONE feature... #54

Merged
Virgil merged 1 commit from agent/read---spec-code-core-go-i18n-rfc-md-ful into dev 2026-04-01 23:57:06 +00:00
2 changed files with 22 additions and 1 deletions

View file

@ -61,6 +61,14 @@ func CurrentMode() Mode {
return ModeNormal
}
// CurrentFormality returns the current default formality.
func CurrentFormality() Formality {
if svc := Default(); svc != nil {
return svc.Formality()
}
return FormalityNeutral
}
// N formats a number using the i18n.numeric.* namespace.
//
// N("number", 1234567) // "1,234,567"

View file

@ -95,7 +95,7 @@ func TestIsRTLLanguage_Good(t *testing.T) {
{"german", "de", false},
{"french", "fr", false},
{"unknown", "xx", false},
{"arabic_variant", "ar-EG-extra", true}, // len > 2 prefix check
{"arabic_variant", "ar-EG-extra", true}, // len > 2 prefix check
{"english_variant", "en-US-extra", false}, // len > 2, not RTL
}
for _, tt := range tests {
@ -119,6 +119,19 @@ func TestSetFormality_Good(t *testing.T) {
assert.Equal(t, FormalityNeutral, svc.Formality())
}
// --- Package-level CurrentFormality ---
func TestCurrentFormality_Good(t *testing.T) {
svc, err := New()
require.NoError(t, err)
SetDefault(svc)
assert.Equal(t, FormalityNeutral, CurrentFormality())
SetFormality(FormalityFormal)
assert.Equal(t, FormalityFormal, CurrentFormality())
}
// --- Package-level Direction ---
func TestDirection_Good(t *testing.T) {