Skip to content

Commit

Permalink
Use gnome-shell translations when possible
Browse files Browse the repository at this point in the history
  • Loading branch information
Tommimon committed Dec 8, 2020
1 parent 020269c commit 85d8d3c
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 49 deletions.
10 changes: 1 addition & 9 deletions po/de.po
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,6 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"

#: shortcutMaker.js:47
#: shortcutMaker.js:52
msgid "Add to Desktop"
msgstr "Zum Desktop hinzufügen"

#: shortcutMaker.js:33
msgid "Add to Favorites"
msgstr "Zu den Favoriten hinzufügen"

#: shortcutMaker.js:33
msgid "Remove from Favorites"
msgstr "Von Favoriten entfernen"
10 changes: 1 addition & 9 deletions po/es.po
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,6 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"

#: shortcutMaker.js:47
#: shortcutMaker.js:52
msgid "Add to Desktop"
msgstr "Agregar al Escritorio"

#: shortcutMaker.js:33
msgid "Add to Favorites"
msgstr "Agregar a Favoritos"

#: shortcutMaker.js:33
msgid "Remove from Favorites"
msgstr "Quitar de Favoritos"
10 changes: 1 addition & 9 deletions po/fr.po
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,6 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"

#: shortcutMaker.js:47
#: shortcutMaker.js:52
msgid "Add to Desktop"
msgstr "Ajouter au Bureau"

#: shortcutMaker.js:33
msgid "Add to Favorites"
msgstr "Ajouter aux Favoris"

#: shortcutMaker.js:33
msgid "Remove from Favorites"
msgstr "Retirer des Favoris"
10 changes: 1 addition & 9 deletions po/it.po
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,6 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"

#: shortcutMaker.js:47
#: shortcutMaker.js:52
msgid "Add to Desktop"
msgstr "Aggiungi alla Scrivania"

#: shortcutMaker.js:33
msgid "Add to Favorites"
msgstr "Aggiungi ai Preferiti"

#: shortcutMaker.js:33
msgid "Remove from Favorites"
msgstr "Rimuovi dai Preferiti"
10 changes: 1 addition & 9 deletions po/nl.po
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,6 @@ msgstr ""
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
"X-Generator: Poedit 2.4.2\n"

#: shortcutMaker.js:47
#: shortcutMaker.js:52
msgid "Add to Desktop"
msgstr "Bureaubladsnelkoppeling maken"

#: shortcutMaker.js:33
msgid "Add to Favorites"
msgstr "Toevoegen aan favorieten"

#: shortcutMaker.js:33
msgid "Remove from Favorites"
msgstr "Verwijderen uit favorieten"
13 changes: 9 additions & 4 deletions shortcutMaker.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,17 @@ const GLib = imports.gi.GLib;
const AppDisplay = imports.ui.appDisplay;
const PopupMenu = imports.ui.popupMenu;
const Gettext = imports.gettext;
Gettext.bindtextdomain( 'add-to-desktop', Me.dir.get_child('locale').get_path() );
Gettext.textdomain('add-to-desktop');
const _ = Gettext.gettext;
const Config = imports.misc.config;
Gettext.textdomain(Config.GETTEXT_PACKAGE); // use 'gnome-shell' as default domain
const shell_gettext = Gettext.gettext;
Gettext.bindtextdomain( 'add-to-desktop', Me.dir.get_child('locale').get_path());

var DEFAULT_AND_UEXEC = 0o00764;

function _(stringIn) {
return Gettext.dgettext('add-to-desktop', stringIn)
}

// override the context menu rebuild method to add the new item
function editMenuClass(parentMenu) {
AppDisplay.AppIconMenu = class CustomMenu extends parentMenu {
Expand All @@ -30,7 +35,7 @@ function editMenuClass(parentMenu) {

function insertAddToDesktopButton(menu) {
// look for both english and translated
let nameArray = ['Add to Favorites', 'Remove from Favorites', _('Add to Favorites'), _('Remove from Favorites')]
let nameArray = ['Add to Favorites', 'Remove from Favorites', shell_gettext('Add to Favorites'), shell_gettext('Remove from Favorites')]
let itemsArray = menu._getMenuItems();
let pos = -1;
for(let i = itemsArray.length-1; i >= 0; i--) {
Expand Down

0 comments on commit 85d8d3c

Please sign in to comment.