Skip to content

Commit

Permalink
Merge pull request linuxmint#6157 from claudiux/SpiceSpy_2.2.0
Browse files Browse the repository at this point in the history
[SpiceSpy@claudiux] v2.2.0 - Improved translation counting
  • Loading branch information
claudiux authored Jul 3, 2024
2 parents c17e6e9 + 977c30a commit d193b02
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
5 changes: 5 additions & 0 deletions SpiceSpy@claudiux/files/SpiceSpy@claudiux/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
### v2.2.0~20240703

* Improved translation counting.


### v2.1.0~20240628

* Adds new translations count in label.
Expand Down
9 changes: 8 additions & 1 deletion SpiceSpy@claudiux/files/SpiceSpy@claudiux/applet.js
Original file line number Diff line number Diff line change
Expand Up @@ -354,8 +354,15 @@ class SpiceSpy extends Applet.TextIconApplet {
if (this.uuids.indexOf(_uuid) > -1 || this.authors.indexOf(spices[spice].author_user) > -1) {
let _nb_translations = 0;
if (type!="themes") { // No translations for themes.
var list_translations = [];
let _nb_translations_keys = Object.keys(spices[spice]["translations"]);
_nb_translations = Math.round(_nb_translations_keys.length / 2);
for (let tKey of _nb_translations_keys) {
let t = tKey.slice(tKey.indexOf("_")+1);
if (list_translations.indexOf(t) < 0)
list_translations.push(t);
}
_nb_translations = list_translations.length;
//~ global.log(""+type+"|"+_uuid+": "+list_translations);
}
_spices_to_spy[type][_uuid] = {
"type": type,
Expand Down
2 changes: 1 addition & 1 deletion SpiceSpy@claudiux/files/SpiceSpy@claudiux/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"uuid": "SpiceSpy@claudiux",
"name": "SpiceSpy",
"description": "Notifies you when there's a change to your favorite Spices on the website.",
"version": "2.1.0",
"version": "2.2.0",
"max-instances": 1,
"author": "claudiux"
}

0 comments on commit d193b02

Please sign in to comment.