From 5dfae3ac0c66c71a7665c4482d94aef98f8f917b Mon Sep 17 00:00:00 2001 From: Kayvan Sylvan Date: Mon, 16 Feb 2026 04:32:30 -0800 Subject: [PATCH] refactor: replace hardcoded error string with i18n translation lookup - Remove `NoSessionPatternUserMessages` constant from `chatter.go` - Replace direct constant reference with `i18n.T()` translation call - Update test import from `core` package to `i18n` package - Update test assertion to use localized error message lookup --- internal/cli/cli_test.go | 4 ++-- internal/core/chatter.go | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/internal/cli/cli_test.go b/internal/cli/cli_test.go index 55444478..1d24d682 100644 --- a/internal/cli/cli_test.go +++ b/internal/cli/cli_test.go @@ -4,7 +4,7 @@ import ( "os" "testing" - "github.com/danielmiessler/fabric/internal/core" + "github.com/danielmiessler/fabric/internal/i18n" "github.com/stretchr/testify/assert" ) @@ -17,5 +17,5 @@ func TestCli(t *testing.T) { os.Args = []string{os.Args[0]} err := Cli("test") assert.Error(t, err) - assert.Equal(t, core.NoSessionPatternUserMessages, err.Error()) + assert.Equal(t, i18n.T("chatter_error_no_session_pattern_user_messages"), err.Error()) } diff --git a/internal/core/chatter.go b/internal/core/chatter.go index b87395f9..cc60033d 100644 --- a/internal/core/chatter.go +++ b/internal/core/chatter.go @@ -17,8 +17,6 @@ import ( "github.com/danielmiessler/fabric/internal/plugins/template" ) -const NoSessionPatternUserMessages = "no session, pattern or user messages provided" - type Chatter struct { db *fsdb.Db