Skip to content

Commit

Permalink
Merge pull request #29 from pentie/master
Browse files Browse the repository at this point in the history
add compatibility to both 3.2 and 3.4
  • Loading branch information
kagesenshi committed Jul 20, 2012
2 parents 2fa8b18 + c2706b1 commit 4a8d992
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions extension.js
Expand Up @@ -709,7 +709,22 @@ PidginClient.prototype = {
}
}

function init(metadata) {
imports.gettext.bindtextdomain('gnome-shell-extensions', imports.misc.config.LOCALEDIR);
function init(metaObject) {
var LocalDir;

// gnome-shell 3.4
if ("metadata" in metaObject) {
LocalDir = metaObject.metadata.localedir;
}
// gnome-shell 3.2
else if ("localedir" in metaObject) {
LocalDir = metaObject.localedir;
}
// don't know what happends, hardcode it.
else {
LocalDir = "/usr/share/locale";
}

imports.gettext.bindtextdomain('gnome-shell-extensions', LocalDir);
return new PidginClient();
}
}

0 comments on commit 4a8d992

Please sign in to comment.