From f9b6f1ffbc25523c9cb0da43ea2bb91448b8c0dd Mon Sep 17 00:00:00 2001 From: Simon Schneegans Date: Fri, 28 Jan 2022 15:00:35 +0100 Subject: [PATCH] :wrench: Load translations --- prefs.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/prefs.js b/prefs.js index ffe9c17..2d5d93a 100644 --- a/prefs.js +++ b/prefs.js @@ -15,6 +15,8 @@ const {Gio, Gtk, Gdk, GLib, GObject} = imports.gi; +const _ = imports.gettext.domain('burn-my-windows').gettext; + const ExtensionUtils = imports.misc.extensionUtils; const Me = imports.misc.extensionUtils.getCurrentExtension(); const utils = Me.imports.src.utils; @@ -350,7 +352,7 @@ var PreferencesDialog = class PreferencesDialog { spacing: 10, }); - const label = Gtk.Label.new('Close this Window to Preview the Effect!'); + const label = Gtk.Label.new(_('Close this Window to Preview the Effect!')); label.get_style_context().add_class('large-title'); const image = new Gtk.Image({ @@ -376,8 +378,10 @@ var PreferencesDialog = class PreferencesDialog { } } -// Nothing to do for now... -function init() {} +// This is used for setting up the translations. +function init() { + ExtensionUtils.initTranslations(); +} // This function is called when the preferences window is created to build and return a // Gtk widget. We create a new instance of the PreferencesDialog class each time this