EspañolDeutschFrançaisItalianoPortuguêsРусскийΕλληνικά日本語中文(简体)हिन्दी; हिंदीالعربية
PF Preguntas - Foro

¿Cómo determino el idioma actual de una página de WordPress cuando uso multiples idiomas?

Busco una variable que guarde el idioma que se esté usando en ese momento. Algo como:

if ( $current_lang == 'es' ) {

 

Share on Facebook Tweet about this on Twitter Share on Google+ Pin on Pinterest Share on Reddit Share on VK Share on StumbleUpon Share on Tumblr Share on LinkedIn Email this to someone Print this page
ReilQ preguntó hace 7 años
1 Respuestas
Mejor Respuesta

Muy fácil ReilQ, prueba así:

if (get_locale() == 'es_ES') {

La función get_locale() te devolverá, dependiendo del idioma, una cadena del tipo ‘es_ES’, ‘en_GB’, ‘en_US’, …

Share on Facebook Tweet about this on Twitter Share on Google+ Pin on Pinterest Share on Reddit Share on VK Share on StumbleUpon Share on Tumblr Share on LinkedIn Email this to someone Print this page
tirex respondió hace 7 años