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

Get the locale of current site and send it to lang-guess #626

Merged
merged 4 commits into from
Jun 17, 2024

Conversation

renintw
Copy link
Contributor

@renintw renintw commented Jun 13, 2024

Closes WordPress/Learn#2428

The locale information for Learn comes from the query parameter "locale" rather than the URL subdomain, so this PR retrieves the locale and sends it to lang guess for processing.

lang-guess corresponding tweaks: meta.trac.wordpress.org/ticket/7675

@renintw renintw self-assigned this Jun 13, 2024
@renintw renintw added [Type] Enhancement New feature or request [Block] Language Suggestion Redesign Related to the wordpress.org redesign project labels Jun 13, 2024
@renintw renintw changed the title Get the locale of current site and send it to lang-guess. Jun 13, 2024
mu-plugins/blocks/language-suggest/src/front.js Outdated Show resolved Hide resolved
mu-plugins/blocks/language-suggest/language-suggest.php Outdated Show resolved Hide resolved
@renintw renintw merged commit 2543908 into trunk Jun 17, 2024
2 checks passed
@renintw renintw deleted the 2428-add-locale-suggestion-banner branch June 17, 2024 18:34
@ryelle
Copy link
Contributor

ryelle commented Jun 17, 2024

It looks like this triggers a notice now, I'm seeing this on my local env:

Notice: Function wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the language-suggest-front handle. Please see Debugging in WordPress for more information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Language Suggestion Redesign Related to the wordpress.org redesign project [Type] Enhancement New feature or request
3 participants