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

i18n: Wrap domains list filter button for translation #59634

Merged
merged 1 commit into from Jan 20, 2022

Conversation

jornp
Copy link
Contributor

@jornp jornp commented Dec 30, 2021

Changes proposed in this Pull Request

  • Wraps the option labels of the domains list filter button in translate calls.

Before & after on /domains/manage

Before & after on /domains/manage/[mysite]

Testing instructions

  1. Open http://calypso.localhost:3000/ and change your interface language to Dutch (because those translations are complete).
  2. Open http://calypso.localhost:3000/domains/manage and verify that the options in the filter button are translated, matching the first "after" screenshot above.
  3. Use the site switcher at the top left to switch to a site, navigate to Upgrades > Domeinen if you're not already there, and verify that the options in the filter button are translated, matching the second "after" screenshot above.

Related to 362-gh-Automattic/i18n-issues

@jornp jornp added the [Status] String Freeze Add the [Status] String Freeze label to your PR to ensure new strings are translated before merging label Dec 30, 2021

const selectedFilter = context?.query?.filter;
const nonWpcomDomains = this.mergeFilteredDomainsWithDomainsDetails();

const filterOptions = [
{
label: 'All domains',
label: translate( 'All domains' ),
Copy link

Choose a reason for hiding this comment

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

ℹ️ String reuse speeds up translation and improves consistency. The following string might make a good alternative and has already been translated 29 times:
translate( 'All Domains' ) ES Score: 10
See 2 additional suggestions in the PR translation status page


const selectedFilter = context?.query?.filter;
const nonWpcomDomains = filterOutWpcomDomains( domains );

const filterOptions = [
{
label: 'Site domains',
label: translate( 'Site domains' ),
Copy link

Choose a reason for hiding this comment

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

ℹ️ String reuse speeds up translation and improves consistency. The following string might make a good alternative and has already been translated 26 times:
translate( 'Site Domains' ) ES Score: 10
See 2 additional suggestions in the PR translation status page

@matticbot
Copy link
Contributor

matticbot commented Dec 30, 2021

Here is how your PR affects size of JS and CSS bundles shipped to the user's browser:

Sections (~25 bytes added 📈 [gzipped])

name     parsed_size           gzip_size
domains        +45 B  (+0.0%)      +25 B  (+0.0%)

Sections contain code specific for a given set of routes. Is downloaded and parsed only when a particular route is navigated to.

Legend

What is parsed and gzip size?

Parsed Size: Uncompressed size of the JS and CSS files. This much code needs to be parsed and stored in memory.
Gzip Size: Compressed size of the JS and CSS files. This much data needs to be downloaded over network.

Generated by performance advisor bot at iscalypsofastyet.com.

@a8ci18n
Copy link

a8ci18n commented Dec 30, 2021

This Pull Request is now available for translation here: https://translate.wordpress.com/deliverables/7066108

Thank you @jornp for including a screenshot in the description! This is really helpful for our translators.

@jornp jornp removed the [Status] String Freeze Add the [Status] String Freeze label to your PR to ensure new strings are translated before merging label Dec 30, 2021
@jornp jornp requested a review from a team December 30, 2021 16:30
@matticbot matticbot added the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Dec 30, 2021
@jornp jornp marked this pull request as ready for review December 30, 2021 16:30
@jornp jornp requested a review from a team as a code owner December 30, 2021 16:30
@a8ci18n
Copy link

a8ci18n commented Dec 30, 2021

Translation for this Pull Request has now been finished.

Copy link
Member

@yuliyan yuliyan left a comment

Choose a reason for hiding this comment

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

I was not able to test the translations as shown on the screenshots, due to strings currently not being in GlotPress, but I've confirmed the filter labels are now being rendered as translatable strings. LGTM 🚀

@jornp jornp force-pushed the fix/domains-filter-button-l10n branch from 51bd9e0 to 29b3fe4 Compare January 20, 2022 16:22
@jornp jornp merged commit e6e1fe2 into trunk Jan 20, 2022
@jornp jornp deleted the fix/domains-filter-button-l10n branch January 20, 2022 16:47
@github-actions github-actions bot removed the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Jan 20, 2022
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.

None yet

4 participants