Hello!
You can set the site’s locale at “Settings > General > Site Language.” It must match the language of your content. In your case, you should select English (Australia).
After updating it, TSF will change the og:locale attribute accordingly. This setting will also affect the <html> language attributes, but it seems you have changed that to en-AU via a different method.
For completeness, if you prefer to use a different language for administration, then you can set it at “Users > Profile > Language.”
I hope this helps. Cheers!
Thank you for you suggestions Sybre, It’s weird because the site is set to language English (Australia) in Settings and Users, and in the Installer details in cPanel. No sure what else I can do. Is it worth adding some code to the header?
Ah, oops! This little quirk slipped my mind. It’s been nearly 7 years since I discussed this.
Facebook (the leading proponent of Open Graph) does not support en_AU and used to display errors if you used it. TSF falls back to the first match in the supported list for en_, which is en_GB.
Here’s some background: https://ww.wp.xz.cn/support/topic/oglocale-problem/.
Here you can find a more current list of locales Facebook supports in one part of its ecosystem — still no Australian English: https://developers.facebook.com/docs/messenger-platform/messenger-profile/supported-locales/.
Diving deeper into it again, I found:
1. New updated docs: https://developers.facebook.com/docs/sharing/webmasters#markup
2. Which links to: https://developers.facebook.com/docs/javascript/internationalization#locales
3. Which proposed to test for: https://connect.facebook.net/en_AU/all.js
4. Which then shows en_US in the header comment.
A supported language, such as en_GB, shows exactly that in the header: https://connect.facebook.net/en_GB/all.js.
So, I must conclude that en_AU is still not supported.
I just tested en_AU on my site, and also a few others that definitely do not exist, and Facebook no longer complains about it to the user. Though I think it’s safer to stick with the fallback, you can use this filter to force en_AU:
add_filter(
'the_seo_framework_meta_render_data',
function ( $tags_render_data ) {
if ( isset( $tags_render_data['og:locale'] ) )
$tags_render_data['og:locale']['attributes']['content'] = 'en_AU';
return $tags_render_data;
}
);
(Where do I place filters?)
Oh thank you for going the extra mile – I really appreciate it.
It just confused me because the site is set everywhere I could think and updates include the Australian translations.
I will add the filter to my child theme and see how it goes. The site is specifically about Australian podcasts so even if viewed elsewhere it will probably be fine. And if not I can always change it back.
Thank you again – you are fabulous!
Anytime! 🙂
I scraped Facebook’s locale JS SDK yesterday (testing 46500 locale combinations) and found that it only supports 104 locales. This updated list will be part of the next plugin update.
I verified that if the locale is not supported, Facebook always defaults back to en_US. So, although there’s no harm in using en_AU or any other unsupported locale, it will probably be treated as en_US until they support it.
Since your site is in English and Facebook falls back to English, you won’t notice anything by setting en_AU. For any other language, I recommend against using the filter and allowing TSF to set a supported fallback locale.