1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-08-06 17:41:00 +00:00

refactor(locale): unexport a symbol

This commit is contained in:
jvoisin 2025-07-06 00:28:00 +02:00 committed by Frédéric Guillot
parent 8e86004936
commit 915b7b3cf7
2 changed files with 4 additions and 4 deletions

View file

@ -17,7 +17,7 @@ var defaultCatalog = make(catalog, len(AvailableLanguages))
//go:embed translations/*.json
var translationFiles embed.FS
func GetTranslationDict(language string) (translationDict, error) {
func getTranslationDict(language string) (translationDict, error) {
if _, ok := defaultCatalog[language]; !ok {
var err error
if defaultCatalog[language], err = loadTranslationFile(language); err != nil {

View file

@ -11,7 +11,7 @@ type Printer struct {
}
func (p *Printer) Print(key string) string {
if dict, err := GetTranslationDict(p.language); err == nil {
if dict, err := getTranslationDict(p.language); err == nil {
if str, ok := dict[key]; ok {
if translation, ok := str.(string); ok {
return translation
@ -25,12 +25,12 @@ func (p *Printer) Print(key string) string {
func (p *Printer) Printf(key string, args ...any) string {
translation := key
if dict, err := GetTranslationDict(p.language); err == nil {
str, found := dict[key]
if found {
var valid bool
translation, valid = str.(string)
if !valid {
if dict, err := getTranslationDict(p.language); err == nil {
translation = key
}
}
@ -41,7 +41,7 @@ func (p *Printer) Printf(key string, args ...any) string {
// Plural returns the translation of the given key by using the language plural form.
func (p *Printer) Plural(key string, n int, args ...interface{}) string {
dict, err := GetTranslationDict(p.language)
dict, err := getTranslationDict(p.language)
if err != nil {
return key
}