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

test(locale): increase test coverage to 100%

This commit is contained in:
Frédéric Guillot 2025-07-07 17:35:48 -07:00
parent e7b98afdbe
commit f860daef7f
4 changed files with 699 additions and 62 deletions

View file

@ -10,6 +10,11 @@ type Printer struct {
language string
}
// NewPrinter creates a new Printer instance for the given language.
func NewPrinter(language string) *Printer {
return &Printer{language}
}
func (p *Printer) Print(key string) string {
if dict, err := getTranslationDict(p.language); err == nil {
if str, ok := dict[key]; ok {
@ -65,8 +70,3 @@ func (p *Printer) Plural(key string, n int, args ...interface{}) string {
return key
}
// NewPrinter creates a new Printer.
func NewPrinter(language string) *Printer {
return &Printer{language}
}