mirror of
https://github.com/osmarks/mycorrhiza.git
synced 2024-12-12 13:30:26 +00:00
b1cdb1e279
All the remaining QTPL files were spread across the codebase. The plan is to get rid of them step by step and migrate to the new l10n approach, all based on Go std templates.
23 lines
305 B
Go
23 lines
305 B
Go
package auth
|
|
|
|
type L10nEntry struct {
|
|
_en string
|
|
_ru string
|
|
}
|
|
|
|
func En(v string) L10nEntry {
|
|
return L10nEntry{_en: v}
|
|
}
|
|
|
|
func (e L10nEntry) Ru(v string) L10nEntry {
|
|
e._ru = v
|
|
return e
|
|
}
|
|
|
|
func (e L10nEntry) Get(lang string) string {
|
|
if lang == "ru" && e._ru != "" {
|
|
return e._ru
|
|
}
|
|
return e._en
|
|
}
|