Skip to content

Commit

Permalink
NightLightSwitch@claudiux: Add tooltips (#6960)
Browse files Browse the repository at this point in the history
* Show tooltips when hovering the applet icon

* Bump version

* Dont fallback to the window translation if no translation is available

* Update CHANGELOG.md
  • Loading branch information
anaximeno authored Mar 7, 2025
1 parent efaab66 commit d9e1ffa
Show file tree
Hide file tree
Showing 8 changed files with 66 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const PopupMenu = imports.ui.popupMenu;
const Util = imports.misc.util;
const St = imports.gi.St;
const GLib = imports.gi.GLib;
const Gettext = imports.gettext;
//~ const CinnamonDesktop = imports.gi.CinnamonDesktop;
//~ const RROutput = CinnamonDesktop.RROutput;

Expand All @@ -16,6 +17,13 @@ const GLib = imports.gi.GLib;

const UUID = "NightLightSwitch@claudiux";

Gettext.bindtextdomain(UUID, GLib.get_home_dir() + "/.local/share/locale");

function _(text) {
return Gettext.dgettext(UUID, text);
}


//~ class BrightnessSlider extends PopupMenu.PopupSliderMenuItem {
//~ constructor(applet, label, icon, busName, minimum_value) {
//~ super(0);
Expand Down Expand Up @@ -223,8 +231,10 @@ class NightLightSwitch extends Applet.IconApplet {
this.nightLightEnabled = this.gsettings.get_boolean("night-light-enabled");
if (this.nightLightEnabled) {
this.set_applet_icon_symbolic_name("night-light-2-symbolic");
this.set_applet_tooltip(_("Night Light Enabled - Click to Disable"));
} else {
this.set_applet_icon_symbolic_name("night-light-disabled-2-symbolic");
this.set_applet_tooltip(_("Night Light Disabled - Click to Enable"));
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
### v1.0.2~20250306
* Adds applet tooltips

### v1.0.1~20250124
* Fixes #6800. No longer requires the gir1.2-gweather-4.0 package.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
"uuid": "NightLightSwitch@claudiux",
"name": "Night Light Switch",
"author": "claudiux",
"version": "1.0.1"
"version": "1.0.2"
}
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# NIGHT LIGHT SWITCH
# This file is put in the public domain.
# claudiux, 2016
# claudiux, 2025
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: NightLightSwitch@claudiux 1.0.0\n"
"Project-Id-Version: NightLightSwitch@claudiux 1.0.1\n"
"Report-Msgid-Bugs-To: https://github.com/linuxmint/cinnamon-spices-applets/"
"issues\n"
"POT-Creation-Date: 2025-01-23 21:14+0100\n"
"POT-Creation-Date: 2025-03-06 19:22-0100\n"
"PO-Revision-Date: \n"
"Last-Translator: \n"
"Language-Team: \n"
Expand All @@ -17,10 +17,18 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"

#. 6.4/applet.js:197
#. 6.4/applet.js:207
msgid "Configure..."
msgstr ""

#. 6.4/applet.js:235
msgid "Night Light Enabled - Click to Disable"
msgstr ""

#. 6.4/applet.js:238
msgid "Night Light Disabled - Click to Enable"
msgstr ""

#. metadata.json->description
msgid "A simple Cinnamon applet to activate/deactivate Night Light mode."
msgstr ""
Expand Down
12 changes: 10 additions & 2 deletions NightLightSwitch@claudiux/files/NightLightSwitch@claudiux/po/ca.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgstr ""
"Project-Id-Version: NightLightSwitch@claudiux 1.0.0\n"
"Report-Msgid-Bugs-To: https://github.com/linuxmint/cinnamon-spices-applets/"
"issues\n"
"POT-Creation-Date: 2025-01-23 21:14+0100\n"
"POT-Creation-Date: 2025-03-06 19:22-0100\n"
"PO-Revision-Date: \n"
"Last-Translator: Odyssey <[email protected]>\n"
"Language-Team: \n"
Expand All @@ -18,10 +18,18 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 3.4.2\n"

#. 6.4/applet.js:197
#. 6.4/applet.js:207
msgid "Configure..."
msgstr "Configura..."

#. 6.4/applet.js:235
msgid "Night Light Enabled - Click to Disable"
msgstr ""

#. 6.4/applet.js:238
msgid "Night Light Disabled - Click to Enable"
msgstr ""

#. metadata.json->description
msgid "A simple Cinnamon applet to activate/deactivate Night Light mode."
msgstr ""
Expand Down
12 changes: 10 additions & 2 deletions NightLightSwitch@claudiux/files/NightLightSwitch@claudiux/po/es.po
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ msgstr ""
"Project-Id-Version: NightLightSwitch@claudiux 1.0.0\n"
"Report-Msgid-Bugs-To: https://github.com/linuxmint/cinnamon-spices-applets/"
"issues\n"
"POT-Creation-Date: 2025-01-23 21:14+0100\n"
"POT-Creation-Date: 2025-03-06 19:22-0100\n"
"PO-Revision-Date: \n"
"Last-Translator: \n"
"Language-Team: \n"
Expand All @@ -17,10 +17,18 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 3.4.4\n"

#. 6.4/applet.js:197
#. 6.4/applet.js:207
msgid "Configure..."
msgstr "Configurar..."

#. 6.4/applet.js:235
msgid "Night Light Enabled - Click to Disable"
msgstr ""

#. 6.4/applet.js:238
msgid "Night Light Disabled - Click to Enable"
msgstr ""

#. metadata.json->description
msgid "A simple Cinnamon applet to activate/deactivate Night Light mode."
msgstr ""
Expand Down
12 changes: 10 additions & 2 deletions NightLightSwitch@claudiux/files/NightLightSwitch@claudiux/po/fr.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgstr ""
"Project-Id-Version: NightLightSwitch@claudiux 1.0.0\n"
"Report-Msgid-Bugs-To: https://github.com/linuxmint/cinnamon-spices-applets/"
"issues\n"
"POT-Creation-Date: 2025-01-23 21:14+0100\n"
"POT-Creation-Date: 2025-03-06 19:22-0100\n"
"PO-Revision-Date: \n"
"Last-Translator: claudiux\n"
"Language-Team: \n"
Expand All @@ -18,10 +18,18 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 3.4.2\n"

#. 6.4/applet.js:197
#. 6.4/applet.js:207
msgid "Configure..."
msgstr "Configurer..."

#. 6.4/applet.js:235
msgid "Night Light Enabled - Click to Disable"
msgstr ""

#. 6.4/applet.js:238
msgid "Night Light Disabled - Click to Enable"
msgstr ""

#. metadata.json->description
msgid "A simple Cinnamon applet to activate/deactivate Night Light mode."
msgstr "Une simple applet Cinnamon pour activer/désactiver le mode Nuit."
Expand Down
12 changes: 10 additions & 2 deletions NightLightSwitch@claudiux/files/NightLightSwitch@claudiux/po/nl.po
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ msgstr ""
"Project-Id-Version: NightLightSwitch@claudiux 1.0.0\n"
"Report-Msgid-Bugs-To: https://github.com/linuxmint/cinnamon-spices-applets/"
"issues\n"
"POT-Creation-Date: 2025-01-23 21:14+0100\n"
"POT-Creation-Date: 2025-03-06 19:22-0100\n"
"PO-Revision-Date: 2025-02-21 18:55+0100\n"
"Last-Translator: qadzek\n"
"Language-Team: \n"
Expand All @@ -16,10 +16,18 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"

#. 6.4/applet.js:197
#. 6.4/applet.js:207
msgid "Configure..."
msgstr "Configureren..."

#. 6.4/applet.js:235
msgid "Night Light Enabled - Click to Disable"
msgstr ""

#. 6.4/applet.js:238
msgid "Night Light Disabled - Click to Enable"
msgstr ""

#. metadata.json->description
msgid "A simple Cinnamon applet to activate/deactivate Night Light mode."
msgstr ""
Expand Down

0 comments on commit d9e1ffa

Please sign in to comment.