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

Update translations with translator comment to a single line #245

Merged
merged 1 commit into from
Jul 8, 2022

Conversation

renatho
Copy link
Contributor

@renatho renatho commented Jul 7, 2022

Changes proposed in this Pull Request

  • It updates all i18n functions to be in a single line when it contains a translator comment.
    • The reason is that the recommended way (that works with all tools that extracts the translations), is to add the translator comments immediately before the string with the placeholders, but the PHPCS and eslint rules for that requires it to be before the function, which makes it inconsistent when we have a multiline i18n function. More details about the PHPCS rule issue: Fixes I18NSniff for multi-line gettext calls WordPress/WordPress-Coding-Standards#1962
  • It was also suggested to not use the _x (translation with context), and replace the HTML entities with the real char. But I decided to not do that, for now, to not have other implications, like invalidating the existing translations.

Testing instructions

  • Go to Settings > General.
  • Update the language of the site to a different language, like "Español".
  • Go to Dashboard > Updates, and click on the button to update the translations.
  • Go to Plugins, and click on Settings under SyntaxHighlighter plugin.
  • Make sure the page continues working properly with the translations. Only the text "The language syntax to highlight with. You can .." doesn't have a translation for "Español".

Context

pxLjZ-79a-p2

@renatho renatho added this to the 3.6.3 milestone Jul 7, 2022
@renatho renatho requested a review from a team July 7, 2022 21:35
@renatho renatho self-assigned this Jul 7, 2022
Copy link
Member

@fjorgemota fjorgemota left a comment

Choose a reason for hiding this comment

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

Looks good and works well! 🎉

@renatho renatho merged commit 13989ac into master Jul 8, 2022
@renatho renatho deleted the fix/translation-translators branch July 8, 2022 18:03
@fjorgemota fjorgemota mentioned this pull request Dec 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants