diff --git a/src/extension.js b/src/extension.js index 58119cc..f82b4fc 100644 --- a/src/extension.js +++ b/src/extension.js @@ -20,7 +20,7 @@ const PanelMenu = imports.ui.panelMenu; const PopupMenu = imports.ui.popupMenu; const Panel = imports.ui.panel; -const Gettext = imports.gettext; +const Gettext = imports.gettext.domain('TeaTime'); const ExtensionUtils = imports.misc.extensionUtils; const Me = ExtensionUtils.getCurrentExtension(); const Utils = Me.imports.utils; @@ -420,4 +420,4 @@ function enable() { function disable() { if (_TeaTime._idleTimeout != null) Mainloop.source_remove(_TeaTime._idleTimeout); _TeaTime.destroy(); -}; \ No newline at end of file +}; diff --git a/src/prefs.js b/src/prefs.js index ca65c80..d9bd782 100644 --- a/src/prefs.js +++ b/src/prefs.js @@ -13,7 +13,7 @@ const Lang = imports.lang; const Gtk = imports.gi.Gtk; const GObject = imports.gi.GObject; -const Gettext = imports.gettext; +const Gettext = imports.gettext.domain('TeaTime'); const ExtensionUtils = imports.misc.extensionUtils; const Me = ExtensionUtils.getCurrentExtension(); const Utils = Me.imports.utils; @@ -320,4 +320,4 @@ function buildPrefsWidget() { widget.show_all(); return widget; -} \ No newline at end of file +} diff --git a/src/utils.js b/src/utils.js index 09d314c..c9d11c2 100644 --- a/src/utils.js +++ b/src/utils.js @@ -5,7 +5,6 @@ const Gio = imports.gi.Gio; const Lang = imports.lang; -const Gettext = imports.gettext; const ExtensionUtils = imports.misc.extensionUtils; const Me = ExtensionUtils.getCurrentExtension(); const Config = imports.misc.config; @@ -44,8 +43,7 @@ function initTranslations(domain) { domain = domain || extension.metadata['gettext-domain']; - Gettext.textdomain(domain); - Gettext.bindtextdomain(domain, getExtensionLocaleDir()); + imports.gettext.bindtextdomain(domain, getExtensionLocaleDir()); } @@ -129,4 +127,4 @@ function playSound(uri) { function setCairoColorFromClutter(cr, c) { let s = 1.0 / 255; cr.setSourceRGBA(s * c.red, s * c.green, s * c.blue, s * c.alpha); -} \ No newline at end of file +}