Skip to content

Commit

Permalink
Small fixes. Load ru translation file.
Browse files Browse the repository at this point in the history
  • Loading branch information
leighmacdonald committed Feb 28, 2023
1 parent 2277f03 commit 34f1fcc
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 13 deletions.
1 change: 0 additions & 1 deletion pkg/rules/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ type Engine struct {
rulesLists []*RuleSchema
playerLists []*PlayerListSchema
knownTags []string
skipTags []string
}

type MarkOpts struct {
Expand Down
2 changes: 1 addition & 1 deletion pkg/rules/engine_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ func TestTextRules(t *testing.T) {
require.Equal(t, tc.matched, re.MatchMessage(tc.text) != nil, "Test %d failed", num)
}
}
require.NoError(t, re.Mark(MarkOpts{}))
require.Error(t, re.Mark(MarkOpts{}))
}

func TestAvatarRules(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion pkg/rules/matchers.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func (m avatarMatcher) Type() avatarMatchType {
func (m avatarMatcher) Match(hexDigest string) *MatchResult {
for _, hash := range m.hashes {
if hash == hexDigest {
return &MatchResult{Origin: m.origin, MatcherType: string(m.Type())}
return &MatchResult{Origin: m.origin, MatcherType: string(m.Type()), Attributes: m.attributes}
}
}
return nil
Expand Down
4 changes: 2 additions & 2 deletions translations/translations.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ func One(key Key) string {
}

func init() {
bundle = i18n.NewBundle(language.English)
bundle = i18n.NewBundle(language.Russian)
bundle.RegisterUnmarshalFunc("yaml", yaml.Unmarshal)
for _, langFile := range []string{"active.en.yaml"} {
for _, langFile := range []string{"active.en.yaml", "ru.yaml"} {
_, errLoad := bundle.LoadMessageFileFS(localeFS, langFile)
if errLoad != nil {
log.Fatalf(errLoad.Error())
Expand Down
8 changes: 0 additions & 8 deletions ui/settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,6 @@ func (s *boundSettings) getBoundStringDefault(key string, def string) binding.St
return binding.BindString(&v)
}

func (s *boundSettings) getBoundStringListDefault(key string, def []string) binding.StringList {
value, apiKeyErr := s.GetValue(key)
if apiKeyErr != nil {
value = def
}
v := value.([]string)
return binding.BindStringList(&v)
}
func (s *boundSettings) getBoundBoolDefault(key string, def bool) binding.Bool {
value, apiKeyErr := s.GetValue(key)
if apiKeyErr != nil {
Expand Down

0 comments on commit 34f1fcc

Please sign in to comment.