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

Desktop: Fixes #6440 Enable translation for 1 command #8852

Merged
merged 4 commits into from
Sep 17, 2023

Conversation

CptMeetKat
Copy link
Contributor

@CptMeetKat CptMeetKat commented Sep 12, 2023

Previously the label on command revealResourceFile was not translating.

By adding an arrow function this allows the command's labels to correctly be deferred to runtime for localisation.

This change brings this command in line with other like commands that do produce accurate translations.

Previously

image

Test Examples

image

Test Steps

  1. Open a language file in Poedit (example)
  2. Add a translation for the string "'Reveal file in folder'"
  3. Run Joplin
  4. Verify label is translated
  5. Search for ":revealResourceFile"
  6. Verify label is translated

Fixes #6440

@CptMeetKat CptMeetKat changed the title Issue 6440 command translations Desktop: Fixes #6440 Enable translation for 2 commands Sep 12, 2023

export const declaration: CommandDeclaration = {
name: 'restoreNoteRevision',
label: 'Restore a note from history',
label: () => _('Restore a note from history'),
Copy link
Owner

Choose a reason for hiding this comment

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

We won't translate this, it's not officially supported

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No worries, I reverted the change to that file and updated the PR

@CptMeetKat CptMeetKat changed the title Desktop: Fixes #6440 Enable translation for 2 commands Desktop: Fixes #6440 Enable translation for 1 command Sep 13, 2023
@laurent22 laurent22 merged commit fed623e into laurent22:dev Sep 17, 2023
1 check passed
@CptMeetKat CptMeetKat deleted the issue-6440-command-translations branch September 24, 2023 13:13
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.

Translation in Command palette
2 participants