mutter/debian/patches/ubuntu/Revert-dash-Use-pin-instead-of-favorites.patch
Ward Nakchbandi (Cosmic Fusion) ebb234de19 initial push
2023-06-27 00:18:37 +03:00

91 lines
3.5 KiB
Diff

From: Gunnar Hjalmarsson <gunnarhj@ubuntu.com>
Date: Mon, 11 Apr 2022 21:10:37 +0200
Subject: Revert "dash: Use pin instead of favorites"
This effectively reverts this commit when using the ubuntu session:
https://gitlab.gnome.org/GNOME/gnome-shell/-/commit/a67877f5
We do that as a temporary measure in Ubuntu 22.04 in order to address
a translation issue. The issue was reported by Mitsuya Shibata:
* https://github.com/micheleg/dash-to-dock/issues/1697
* https://lists.ubuntu.com/archives/ubuntu-translators/2022-April/007829.html
In short: By using the old labels for those menu items, we can make use
of existing gnome-shell translations in Launchpad both for gnome-shell
and ubuntu-dock. Thanks Jeremy Bicha for the idea!
So even if it technically introduces new translatable strings very late,
it does not break the UIF spirit.
Forwarded: not-needed
---
js/ui/appFavorites.js | 12 ++++++++++--
js/ui/appMenu.js | 5 +++--
js/ui/dash.js | 3 +--
3 files changed, 14 insertions(+), 6 deletions(-)
diff --git a/js/ui/appFavorites.js b/js/ui/appFavorites.js
index ca65695..93b8e24 100644
--- a/js/ui/appFavorites.js
+++ b/js/ui/appFavorites.js
@@ -164,7 +164,11 @@ class AppFavorites extends Signals.EventEmitter {
let app = Shell.AppSystem.get_default().lookup_app(appId);
- let msg = _('%s has been pinned to the dash.').format(app.get_name());
+ let msg;
+ if (imports.misc.desktop.is('ubuntu'))
+ msg = _('%s has been added to your favorites.').format(app.get_name());
+ else
+ msg = _('%s has been pinned to the dash.').format(app.get_name());
Main.overview.setMessage(msg, {
forFeedback: true,
undoCallback: () => this._removeFavorite(appId),
@@ -197,7 +201,11 @@ class AppFavorites extends Signals.EventEmitter {
if (!this._removeFavorite(appId))
return;
- let msg = _('%s has been unpinned from the dash.').format(app.get_name());
+ let msg;
+ if (imports.misc.desktop.is('ubuntu'))
+ msg = _('%s has been removed from your favorites.').format(app.get_name());
+ else
+ msg = _('%s has been unpinned from the dash.').format(app.get_name());
Main.overview.setMessage(msg, {
forFeedback: true,
undoCallback: () => this._addFavorite(appId, pos),
diff --git a/js/ui/appMenu.js b/js/ui/appMenu.js
index fec74cf..37f8012 100644
--- a/js/ui/appMenu.js
+++ b/js/ui/appMenu.js
@@ -153,9 +153,10 @@ var AppMenu = class AppMenu extends PopupMenu.PopupMenu {
return;
const { id } = this._app;
+ const isUbuntu = imports.misc.desktop.is('ubuntu');
this._toggleFavoriteItem.label.text = this._appFavorites.isFavorite(id)
- ? _('Unpin')
- : _('Pin to Dash');
+ ? (isUbuntu ? _('Remove from Favorites') : _('Unpin'))
+ : (isUbuntu ? _('Add to Favorites') : _('Pin to Dash'));
}
_updateGpuItem() {
diff --git a/js/ui/dash.js b/js/ui/dash.js
index 1883088..e7cbe67 100644
--- a/js/ui/dash.js
+++ b/js/ui/dash.js
@@ -245,9 +245,8 @@ class ShowAppsIcon extends DashItemContainer {
this.toggleButton.set_hover(canRemove);
if (this._iconActor)
this._iconActor.set_hover(canRemove);
-
if (canRemove)
- this.setLabelText(_('Unpin'));
+ this.setLabelText(imports.misc.desktop.is('ubuntu') ? _('Remove from Favorites') : _('Unpin'));
else
this.setLabelText(_('Show Apps'));
}