WordPress / wporg-mu-plugins

Development of the Global Header and other mu-plugins used on WordPress.org.
63 stars 29 forks source link

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

Closed renintw closed 5 months ago

renintw commented 5 months ago

Closes https://github.com/WordPress/Learn/issues/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

ryelle commented 5 months ago

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.