use descriptive variable names in email translations

in preparation for an email editor.
This commit is contained in:
Harvey Tindall
2021-02-19 17:50:50 +00:00
parent 3e020da66a
commit 5c87d109a3
13 changed files with 93 additions and 48 deletions
+9
View File
@@ -118,6 +118,15 @@ func (ls *setupLangs) getOptions() [][2]string {
}
type langSection map[string]string
type tmpl map[string]string
func (el langSection) template(field string, vals tmpl) string {
text := el.get(field)
for key, val := range vals {
text = strings.ReplaceAll(text, "{"+key+"}", val)
}
return text
}
func (el langSection) format(field string, vals ...string) string {
text := el.get(field)