Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make the 'Pin to Dock' label translatable #2331

Merged
merged 1 commit into from
Dec 3, 2024

Conversation

xalt7x
Copy link
Contributor

@xalt7x xalt7x commented Nov 12, 2024

With the single underscore (_) we can re-use original translation.
However, for the 'Pin to Dock' there's no match since GNOME 42-47 original label is 'Pin to Dash'.
Using two underscores (__) as a translation function resolves #2330

@xalt7x xalt7x force-pushed the fix-pin-to-dock-string branch from eb6833e to 617937a Compare November 12, 2024 22:58
With the single underscore (_) we can re-use original translation.
However, for the 'Pin to Dock' there's no match since GNOME 42-47 original label is 'Pin to Dash'.
Using two underscores (__) as a translation function resolves issue 2330
@xalt7x xalt7x force-pushed the fix-pin-to-dock-string branch from 617937a to 60b4527 Compare November 12, 2024 23:01
@sergio-costas
Copy link
Collaborator

In my opinion, this should be fixed by updating the translations, not by reusing the translation of a different text.

@xalt7x
Copy link
Contributor Author

xalt7x commented Nov 28, 2024

@sergio-costas

In my opinion, this should be fixed by updating the translations, not by reusing the translation of a different text.

I've actually tried updating translation file (before making comparison screenshots I've modified uk_UA.po). Still, my translation of 'Pin to Dock' was unused until I've applied a change from this PR. Please see issue #2104 that confirms that translation updates won't help here.

With the current
const item = this._appendMenuItem(_('Pin to Dock'));
This extension tries to re-use GNOME string. However, Pin to Dock string doesn't exist in GNOME Dash so we receive English/untranslated item.

One can simply try to re-use GNOME Dash string 'Pin to Dash'.
const item = this._appendMenuItem(_('Pin to Dash'));
Now, an item uses GNOME translation but this hacky solution is bad for multiple reasons:

  • Dash to Dock pot file will contain 'Pin to Dash' instead of 'Pin to Dock'.
  • Translators would need to update .po files and translate 'Dash' as 'Dock'. For that, they would need to have knowledge for meaning of the hack, existence of the issue "Pin To Dock" menu item is untranslatable #2330 and discussion in this PR.

With the simple fix I propose
const item = this._appendMenuItem(__('Pin to Dock'));
Pin to Dock translation will be used after .po file updates.

I believe this is the right way.

@sergio-costas
Copy link
Collaborator

@xalt7x Oh!!!! You are right, my fault.

Copy link
Collaborator

@sergio-costas sergio-costas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As commented in the source code

dash-to-dock/appIcons.js

Lines 40 to 41 in 846f1fd

// Use __ () and N__() for the extension gettext domain, and reuse
// the shell domain with the default _() and N_()
and also by the PR author in the comments, this is the right solution.

@sergio-costas sergio-costas merged commit 52dfc08 into micheleg:master Dec 3, 2024
1 check passed
@xalt7x xalt7x deleted the fix-pin-to-dock-string branch December 11, 2024 19:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"Pin To Dock" menu item is untranslatable
2 participants