From 604e6fda58986b972c60908d5e54f97294b8795e Mon Sep 17 00:00:00 2001 From: tishmaria90 Date: Mon, 28 Mar 2022 16:51:41 +0300 Subject: [PATCH] Add localizer interface --- core/localizer.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/core/localizer.go b/core/localizer.go index b00c92c..2c1cd9f 100644 --- a/core/localizer.go +++ b/core/localizer.go @@ -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")