1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-09-15 18:57:04 +00:00

Simplify locale package usage (refactoring)

This commit is contained in:
Frédéric Guillot 2018-09-22 15:04:55 -07:00
parent aae9b4eb83
commit b1e8f534ef
26 changed files with 443 additions and 299 deletions

View file

@ -1,23 +1,9 @@
// Copyright 2017 Frédéric Guillot. All rights reserved.
// Copyright 2018 Frédéric Guillot. All rights reserved.
// Use of this source code is governed by the Apache 2.0
// license that can be found in the LICENSE file.
package locale // import "miniflux.app/locale"
import "miniflux.app/logger"
// Load loads all translations.
func Load() *Translator {
translator := NewTranslator()
for language, tr := range translations {
logger.Debug("Loading translation: %s", language)
translator.AddLanguage(language, tr)
}
return translator
}
// AvailableLanguages returns the list of available languages.
func AvailableLanguages() map[string]string {
return map[string]string{