]> git.ipfire.org Git - ipfire.org.git/commitdiff
messages: Add default locale
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 4 Dec 2018 00:08:46 +0000 (00:08 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 4 Dec 2018 00:08:46 +0000 (00:08 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/backend/messages.py

index c6a052973848b7bcc22d7a2611200cdf3752717a..71e898e922c00ed2c1af12a40a52f61c86efaeeb 100644 (file)
@@ -66,10 +66,16 @@ class Messages(misc.Object):
                """
                        Send a message based on the given template
                """
+               locale = tornado.locale.get("en_US")
+
                # Create the required namespace to render the message
                namespace = {
                        # Generic Stuff
                        "backend" : self.backend,
+
+                       # Locale
+                       "locale"  : locale,
+                       "_"       : locale.translate,
                }
                namespace.update(kwargs)