the comments added to public functions

This commit is contained in:
Roman Perekhod
2024-08-06 14:25:30 +02:00
committed by jkoberg
parent 21c6dda4f8
commit c39bac17c4
2 changed files with 11 additions and 4 deletions
+2
View File
@@ -19,11 +19,13 @@ const (
_domain = "graph"
)
// Translate translates a string based on the locale and default locale
func Translate(content, locale, defaultLocale string) string {
t := l10npkg.NewTranslatorFromCommonConfig(defaultLocale, _domain, "", _localeFS, _localeSubPath)
return t.Translate(content, locale)
}
// NewTranslateLocation returns a function that translates a string based on the locale
func NewTranslateLocation(locale, defaultLocale string) func(string, ...any) string {
t := l10npkg.NewTranslatorFromCommonConfig(defaultLocale, _domain, "", _localeFS, _localeSubPath)
return t.Locale(locale).Get