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
This commit is contained in:
Kayvan Sylvan
2026-02-16 04:32:30 -08:00
parent b8fe1eda0a
commit 5dfae3ac0c
2 changed files with 2 additions and 4 deletions

View File

@@ -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())
}

View File

@@ -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