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.
|
|
|
|
|
2018-08-25 06:51:50 +02:00
|
|
|
package locale // import "miniflux.app/locale"
|
2017-11-20 06:10:04 +01:00
|
|
|
|
2018-08-25 06:51:50 +02:00
|
|
|
import "miniflux.app/logger"
|
2017-11-20 06:10:04 +01:00
|
|
|
|
2018-09-22 03:53:29 +02:00
|
|
|
// Load loads all translations.
|
2017-11-20 06:10:04 +01:00
|
|
|
func Load() *Translator {
|
|
|
|
translator := NewTranslator()
|
|
|
|
|
2017-11-26 00:56:44 +01:00
|
|
|
for language, tr := range translations {
|
2017-12-16 03:55:57 +01:00
|
|
|
logger.Debug("Loading translation: %s", language)
|
2017-11-26 00:56:44 +01:00
|
|
|
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",
|
2018-01-16 02:23:47 +01:00
|
|
|
"de_DE": "Deutsch",
|
2018-02-17 20:29:14 +01:00
|
|
|
"pl_PL": "Polski",
|
2018-02-27 07:36:07 +01:00
|
|
|
"zh_CN": "简体中文",
|
2018-03-16 15:15:15 +01:00
|
|
|
"nl_NL": "Nederlands",
|
2018-09-22 19:22:58 +02:00
|
|
|
"ru_RU": "Русский",
|
2017-11-20 06:10:04 +01:00
|
|
|
}
|
|
|
|
}
|