Skip to content

Commit

Permalink
ref(i18n): use extendio message (#183)
Browse files Browse the repository at this point in the history
  • Loading branch information
plastikfan committed Apr 24, 2023
1 parent 63d60aa commit 1acd5e8
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 17 deletions.
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ require (
github.com/onsi/ginkgo/v2 v2.9.2
github.com/onsi/gomega v1.27.6
github.com/samber/lo v1.38.1
github.com/snivilised/extendio v0.1.13
github.com/snivilised/extendio v0.1.14
github.com/spf13/cobra v1.7.0
github.com/spf13/viper v1.15.0
go.uber.org/zap v1.24.0
Expand Down Expand Up @@ -35,7 +35,7 @@ require (
github.com/magiconair/properties v1.8.7 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/natefinch/lumberjack v2.0.0+incompatible
github.com/nicksnyder/go-i18n/v2 v2.2.1
github.com/nicksnyder/go-i18n/v2 v2.2.1 // indirect
github.com/pelletier/go-toml/v2 v2.0.7 // indirect
github.com/snivilised/cobrass v0.2.0
github.com/spf13/afero v1.9.5 // indirect
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,8 @@ github.com/samber/lo v1.38.1 h1:j2XEAqXKb09Am4ebOg31SpvzUTTs6EN3VfgeLUhPdXM=
github.com/samber/lo v1.38.1/go.mod h1:+m/ZKRl6ClXCE2Lgf3MsQlWfh4bn1bz6CXEOxnEXnEA=
github.com/snivilised/cobrass v0.2.0 h1:3u6jK0KK+glrCGBIZQIbpyeGvATmaUrDhv9asEYKnzY=
github.com/snivilised/cobrass v0.2.0/go.mod h1:/IVkewm12jIhi9anbFKS+zSJH3HfZo7CWztwcXf8h/g=
github.com/snivilised/extendio v0.1.13 h1:BrCSBH/mSaA6T076ySfrYaH+6Ow1Bj2jJfnv9mgUzeI=
github.com/snivilised/extendio v0.1.13/go.mod h1:SO4udqtdfNl/KTLG9GF8kHxoMiIhnvN/9xlqkCCC6VY=
github.com/snivilised/extendio v0.1.14 h1:Is47jRy2WeV21EM5dq1FiTBxAn2SP9GC5Pv0ckni57A=
github.com/snivilised/extendio v0.1.14/go.mod h1:SO4udqtdfNl/KTLG9GF8kHxoMiIhnvN/9xlqkCCC6VY=
github.com/spf13/afero v1.9.5 h1:stMpOSZFs//0Lv29HduCmli3GUfpFoF3Y1Q/aXj/wVM=
github.com/spf13/afero v1.9.5/go.mod h1:UBogFpq8E9Hx+xc5CNTTEpTnuHVmXDwZcZcE1eb/UhQ=
github.com/spf13/cast v1.5.0 h1:rj3WzYc11XZaIZMPKmwP96zkFEnnAmV8s6XbB2aY32w=
Expand Down
25 changes: 19 additions & 6 deletions src/i18n/messages-command.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
package i18n

import (
"github.com/nicksnyder/go-i18n/v2/i18n"
"github.com/snivilised/extendio/i18n"
)

// 🧊 RootCmdShortDesc
// 🧊 Root Cmd Short Description

// RootCmdShortDescTemplData
type RootCmdShortDescTemplData struct {
arcadiaTemplData
}
Expand All @@ -17,7 +19,9 @@ func (td RootCmdShortDescTemplData) Message() *i18n.Message {
}
}

// 🧊 RootCmdLongDesc
// 🧊 Root Cmd Long Description

// RootCmdLongDescTemplData
type RootCmdLongDescTemplData struct {
arcadiaTemplData
}
Expand All @@ -35,7 +39,9 @@ func (td RootCmdLongDescTemplData) Message() *i18n.Message {
}
}

// 🧊 RootCmdConfigFileUsage
// 🧊 Root Cmd Config File Usage

// / RootCmdConfigFileUsageTemplData
type RootCmdConfigFileUsageTemplData struct {
arcadiaTemplData
ConfigFileName string
Expand All @@ -49,6 +55,9 @@ func (td RootCmdConfigFileUsageTemplData) Message() *i18n.Message {
}
}

// 🧊 Root Cmd Lang Usage

// RootCmdLangUsageTemplData
type RootCmdLangUsageTemplData struct {
arcadiaTemplData
}
Expand All @@ -61,7 +70,9 @@ func (td RootCmdLangUsageTemplData) Message() *i18n.Message {
}
}

// 🧊 WidgetCmdShortDesc
// 🧊 Widget Cmd Short Description

// WidgetCmdShortDescTemplData
type WidgetCmdShortDescTemplData struct {
arcadiaTemplData
}
Expand All @@ -74,7 +85,9 @@ func (td WidgetCmdShortDescTemplData) Message() *i18n.Message {
}
}

// 🧊 WidgetCmdLongDesc
// 🧊 Widget Cmd Long Description

// WidgetCmdLongDescTemplData
type WidgetCmdLongDescTemplData struct {
arcadiaTemplData
}
Expand Down
2 changes: 1 addition & 1 deletion src/i18n/messages-general.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package i18n

import (
"github.com/nicksnyder/go-i18n/v2/i18n"
"github.com/snivilised/extendio/i18n"
)

type UsingConfigFileTemplData struct {
Expand Down
8 changes: 3 additions & 5 deletions src/i18n/messages.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
package i18n

import (
"github.com/nicksnyder/go-i18n/v2/i18n"

xi18n "github.com/snivilised/extendio/i18n"
"github.com/snivilised/extendio/i18n"
)

// ❌ FooBar
Expand Down Expand Up @@ -36,7 +34,7 @@ type FooBarErrorBehaviourQuery interface {
}

type FooBarError struct {
xi18n.LocalisableError
i18n.LocalisableError
}

// FooBar enables the client to check if error is FooBarError
Expand All @@ -48,7 +46,7 @@ func (e FooBarError) FooBar() bool {
// NewFooBarError creates a FooBarError
func NewFooBarError(path string, reason error) FooBarError {
return FooBarError{
LocalisableError: xi18n.LocalisableError{
LocalisableError: i18n.LocalisableError{
Data: FooBarTemplData{
Path: path,
Reason: reason,
Expand Down
2 changes: 1 addition & 1 deletion src/i18n/test-i18n-messages_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package i18n_test

import (
"github.com/nicksnyder/go-i18n/v2/i18n"
"github.com/snivilised/extendio/i18n"
)

const (
Expand Down

0 comments on commit 1acd5e8

Please sign in to comment.