Quantcast
Channel: polylang – WordPress.org Forums
Viewing all articles
Browse latest Browse all 11471

Chouby on "[Plugin: ALO EasyMail Newsletter] Can't get current locale (trying to implement Polylang)"

$
0
0

The particularity of Polylang is that it offers two possibilities to set the language

1. based on the content (as Xili language). In that case it is needed to wait for the query beeing parsed to set the language. So it is set in a 'wp' hook.

2. based on the language code added to the url (as WPML and qtranslate). In that case, the language is set much sooner in the 'setup_theme' hook.

The cookie is not a reliable way to get the language (in case the user switches from one language to another) as it is set in the action hooked to 'wp'.


Viewing all articles
Browse latest Browse all 11471

Latest Images

Trending Articles



Latest Images