[agent/codex:gpt-5.4-mini] Read ~/spec/code/core/go/i18n/RFC.md fully. Find ONE feature... #54
2 changed files with 22 additions and 1 deletions
8
i18n.go
8
i18n.go
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue