strarsis/wp-current-locale

Necessity of a separate function

Closed this issue · 0 comments

I've experimented a bit with Polylang and WPML for multi-lingual support in wp-Typography and it appears that just using get_locale() is fine for retrieving the locale. It would appear that at least the major plugins already properly filter this WordPress function. I'll check with Multilingual Press later tonight, but I'm pretty sure they use the filter as well.

Splitting of the language code from the locale is a simple exercise. Things become different if you want to know all valid language codes etc., but just for retrieving the locale, using the various plugin-specific functions seems to be overkill.