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

Jetpack Search: some interface strings are not being localized #20520

Closed
bluefuton opened this issue Aug 2, 2021 · 3 comments · Fixed by #20926 or #21367
Closed

Jetpack Search: some interface strings are not being localized #20520

bluefuton opened this issue Aug 2, 2021 · 3 comments · Fixed by #20926 or #21367
Assignees
Labels
Customer Report Issues or PRs that were reported via Happiness. aka "Happiness Request", or "User Report" [Feature] Search For all things related to Search [Pri] High [Type] Bug When a feature is broken and / or not performing as intended

Comments

@bluefuton
Copy link
Contributor

Steps to reproduce the issue

  1. On your test site with Instant Search enabled, set the site language to 'Français'.
  2. Return to the front end of your site and perform a search.

What I expected

If the site language is French, all of the interface language in the Instant Search modal should also be in French.

What happened instead

The modal shows English strings for "Showing popular results", "Sort" and "clear". Interestingly the sort options themselves are correctly translated (e.g. "Pertinence") so some translations are working as expected.

For example: https://lapidoule.com/?s=bebe

Discovered via 4190269-zen.

Screenshots

Screen Shot 2021-08-02 at 15 03 22

@bluefuton bluefuton added [Type] Bug When a feature is broken and / or not performing as intended [Pri] High [Feature] Search For all things related to Search Instant Search labels Aug 2, 2021
@matticbot matticbot added the Customer Report Issues or PRs that were reported via Happiness. aka "Happiness Request", or "User Report" label Aug 2, 2021
@bluefuton
Copy link
Contributor Author

bluefuton commented Aug 18, 2021

An earlier related issue with some useful information: #15754

My hypothesis is that this is related to the lazy loading changes in #19049, since the translations from jp-search-main.bundle.js appear to be working, but the translations from jp-search.chunk-main-payload-1a2821bfb803906d5e27.js are not.

@sgomes do you know if it's possible to use wp_set_script_translations() in combination with lazy loading?

@sgomes
Copy link
Contributor

sgomes commented Aug 18, 2021

@sgomes do you know if it's possible to use wp_set_script_translations() in combination with lazy loading?

I'm afraid I'm not too familiar with this at all, and the documentation doesn't seem to be particularly helpful 😕

At first glance, I suspect the issue could be that the lazily loaded chunk doesn't get the base script's translations, for some reason. If that's the case, perhaps they could be manually exposed on the base and accessed on the lazily loaded chunk, somehow?

@bluefuton
Copy link
Contributor Author

Thanks @sgomes! Team Global pointed me in the direction of woocommerce/woocommerce-blocks#4392, which looks fairly complicated (more in pxLjZ-6zp-p2#comment-18415).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Customer Report Issues or PRs that were reported via Happiness. aka "Happiness Request", or "User Report" [Feature] Search For all things related to Search [Pri] High [Type] Bug When a feature is broken and / or not performing as intended
Projects
None yet
5 participants