micheleg / dash-to-dock

A dock for the Gnome Shell. This extension moves the dash out of the overview transforming it in a dock for an easier launching of applications and a faster switching between windows and desktops.
https://micheleg.github.io/dash-to-dock/
GNU General Public License v2.0
3.87k stars 461 forks source link

"Show Details" menu item is untranslatable #2104

Closed proninyaroslav closed 7 months ago

proninyaroslav commented 11 months ago

In the Dash To Dock menu the "Show Details" item in English, and for example this string isn't in the Russian translation and xgettext also doesn't see it (I run make potfile command):

2023-10-11 18-35-47

But in the original GNOME Dock the "Show Details" item is translated:

2023-10-11 18-41-07

xalt7x commented 11 months ago

I can confirm this issue.
Unfortunately even when this string is translated, the original text is still shown for some reason.

this string isn't in the Russian translation and xgettext also doesn't see it (I run make potfile command):

That's unrelated because:

  1. This string and few others were missing in most translation files until #2093
  2. make potfile generates po/dashtodock.pot (template for translators) where you can find this string.
krystal-cao commented 11 months ago

@proninyaroslav @xalt7x Because "Show Details" uses the default translation of the Gnome Shell.But the text of the Gnome Shell menu item is "App Details" WX20231101-102714@2x WX20231101-102735@2x WX20231101-102009@2x WX20231101-102528@2x

krystal-cao commented 11 months ago

@proninyaroslav So you can modify _('Show Details') to __('Show Details') in line 1151 of the appIcons.js and build it yourself, I tried it and it works!

proninyaroslav commented 11 months ago

@krystal-cao This is more likely a workaround than a solution. If it uses GNOME translation then why is it only English? In the original GNOME Dock this line is translated.

krystal-cao commented 11 months ago

@proninyaroslav I'm guessing that the text on the line of the original GNOME Dock has been changed from 'Show Details' to 'App Details' since some version. 'App Details' is translated in the original GNOME Dock. 'Show Details' is not translated in the original GNOME Dock. So 'Show Details' is only English.If it uses Gnome translation, then the original text must be the same. You could also change ('Show Details') to ('App Details') and try building it!

proninyaroslav commented 11 months ago

@krystal-cao Yes, it works. Thank you. I created a PR https://github.com/micheleg/dash-to-dock/pull/2117

xalt7x commented 11 months ago

@krystal-cao , thanks for finding it!

@proninyaroslav , I'd like to have it fixed as well but IMO the better approach would be to get rid of some custom overrides (e.g. "Show Details", "Failed to launch", "Launch using Integrated Graphics Card", "Launch using Discrete Graphics Card" etc.) if "Dash to Dock" can just re-use original strings from the GNOME Shell. It should prevent such breakages and preserve consistency with the GNOME upstream decisions/translations.
AFAIK, "Dash to Panel" doesn't have this issue.

proninyaroslav commented 11 months ago

@xalt7x A cursory examination of Dash To Panel showed that they use AppMenu from Shell with minimal customization (only hiding some menu items based on settings). I'm not very familiar with gettext, but it seems to me that it is impossible to simply reuse the translation, since you need to know the source string (in this case App Details): https://gitlab.gnome.org/GNOME/gnome-shell/-/blob/main/js/ui/appMenu.js#L86. Maybe we should just take AppMenu as a basis and extend the class by adding custom things, but it is unknown how this will affect the future compatibility of the extension with Shell.