mirror of
https://github.com/danielmiessler/Fabric.git
synced 2026-02-19 10:14:21 -05:00
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:
@@ -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())
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user