Skip to content

Commit

Permalink
Add localizer interface
Browse files Browse the repository at this point in the history
  • Loading branch information
tishmaria90 authored Mar 28, 2022
1 parent 627ceae commit 604e6fd
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions core/localizer.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ type Localizer struct {
TranslationsPath string
}

type LocalizerInterface interface {
GetLocalizedMessage(messageID string) string
GetLocalizedTemplateMessage(messageID string, templateData map[string]interface{}) string
Localize(messageID string) (string, error)
}

// NewLocalizer returns localizer instance with specified parameters.
// Usage:
// NewLocalizer(language.English, DefaultLocalizerMatcher(), "translations")
Expand Down

0 comments on commit 604e6fd

Please sign in to comment.