Closed jspitz closed 6 years ago
have you tried making "domain" local in scope?
diff --git a/src/utils.js b/src/utils.js
index e18f504..12acfd2 100644
--- a/src/utils.js
+++ b/src/utils.js
@@ -20,7 +20,7 @@ const TEATIME_ALARM_SOUND_KEY = 'alarm-sound-file';
function initTranslations(domain) {
let extension = ExtensionUtils.getCurrentExtension();
- domain = domain || extension.metadata['gettext-domain'];
+ let domain = domain || extension.metadata['gettext-domain'];
Gettext.textdomain(domain);
// check if this extension was built with "make zip-file", and thus
Note that the call to Utils.initTranslations() here doesn't set the domain value.
Probably shouldn't change the parameter though, JS is complaining about that,
Jun 06 08:45:18 woot.home gnome-shell[3437]: JS WARNING: [/home/steeve/.local/share/gnome-shell/extensions/TeaTime@oleid.mescharet.de/utils.js 23]: variable domain redeclares argum
diff --git a/src/utils.js b/src/utils.js
index e18f504..6a3f2b0 100644
--- a/src/utils.js
+++ b/src/utils.js
@@ -17,10 +17,10 @@ const TEATIME_GRAPHICAL_COUNTDOWN_KEY = 'graphical-countdown';
const TEATIME_USE_ALARM_SOUND_KEY = 'use-alarm-sound';
const TEATIME_ALARM_SOUND_KEY = 'alarm-sound-file';
-function initTranslations(domain) {
+function initTranslations(_domain) {
let extension = ExtensionUtils.getCurrentExtension();
- domain = domain || extension.metadata['gettext-domain'];
+ let domain = _domain || extension.metadata['gettext-domain'];
Gettext.textdomain(domain);
// check if this extension was built with "make zip-file", and thus
have you tried making "domain" local in scope?
Tried that now, did not help.
Russian localization for TeaTime.
I find the problem somewhat opaque. What surprises me most is that this page recommends calling Gettext.textdomain (domain)
, but the initTranslations
function from convenience.js
, which is usually copy&pasted to most extensions, doesn't. But oviously, when not setting the domain, no translations are found :/
I have found a solution, though with a hardcoded domain.
@oleid did you see my patch (#40)?
This is fixed with v. 26.
If the TeaTime extension is installed, parts of the gnome shell calendar are not localized. The date order for instance is wrong, and the weather forecast contains a mix of localized and non-localized strings. See screenshots below for the problem.
I have narrowed down the problem to line 25 of
utils.js
:Gettext.textdomain(domain);
If this is commented out, the problem disappears (but of course at the cost of an un-localized tea timer).The following screenshot shows the correct German localization (the offending line commented out):
The one below displays the wrong localization TeaTime causes (check out the date format and the weather forecast):