miniflux/locale/locale.go

34 lines
842 B
Go
Raw Normal View History

2017-11-20 06:10:04 +01:00
// Copyright 2017 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 "log"
// Translation is the translation mapping table.
2017-11-20 06:10:04 +01:00
type Translation map[string]interface{}
// Locales represents locales supported by the system.
2017-11-20 06:10:04 +01:00
type Locales map[string]Translation
// Load prepare the locale system by loading all translations.
2017-11-20 06:10:04 +01:00
func Load() *Translator {
translator := NewTranslator()
for language, tr := range translations {
2017-11-20 06:10:04 +01:00
log.Println("Loading translation:", language)
translator.AddLanguage(language, tr)
2017-11-20 06:10:04 +01:00
}
return translator
}
2017-11-28 06:30:04 +01:00
// AvailableLanguages returns the list of available languages.
func AvailableLanguages() map[string]string {
2017-11-20 06:10:04 +01:00
return map[string]string{
"en_US": "English",
"fr_FR": "Français",
}
}