aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--internal/locale/printer.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/internal/locale/printer.go b/internal/locale/printer.go
index b0f5de6c..f85960fa 100644
--- a/internal/locale/printer.go
+++ b/internal/locale/printer.go
@@ -10,6 +10,15 @@ type Printer struct {
language string
}
+func (p *Printer) Print(key string) string {
+ if str, ok := defaultCatalog[p.language][key]; ok {
+ if translation, ok := str.(string); ok {
+ return translation
+ }
+ }
+ return key
+}
+
// Printf is like fmt.Printf, but using language-specific formatting.
func (p *Printer) Printf(key string, args ...interface{}) string {
var translation string