Title: I need to switch language using programmation
Last modified: August 21, 2016

---

# I need to switch language using programmation

 *  Resolved [kunoichi-kyoto](https://wordpress.org/support/users/kunoichi-kyoto/)
 * (@kunoichi-kyoto)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/i-need-to-switch-language-using-programmation/)
 * The theme I am using contents some links in the menu that are only able to be
   changed by the editor section.
    What I need is the name of the keyword to switch
   that names like:
 * <?php if ( $lang == ca )?> Categories <?php elseif ( $lang == ES_es )?> Categorias
   <?php elseif ( $lang == EN_en )?> Categories <?php } ?>
 * Or something like that. I guess $lang is not the keyword and the name you are
   using in your plugin is not ES_es, but I need this kind of programmation to translate
   some other sentences too.
 * Thanks a lot.
 * [http://wordpress.org/plugins/polylang/](http://wordpress.org/plugins/polylang/)

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [Chouby](https://wordpress.org/support/users/chouby/)
 * (@chouby)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/i-need-to-switch-language-using-programmation/#post-4144413)
 * You can use the native WordPress functions [get_locale](http://codex.wordpress.org/Function_Reference/get_locale)
   or [get_bloginfo](http://codex.wordpress.org/Function_Reference/get_bloginfo).
   You can also use the Polylang function [pll_current_language](http://polylang.wordpress.com/documentation/documentation-for-developers/functions-reference/#pll_current_language).
 *  Thread Starter [kunoichi-kyoto](https://wordpress.org/support/users/kunoichi-kyoto/)
 * (@kunoichi-kyoto)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/i-need-to-switch-language-using-programmation/#post-4144505)
 * Could you be more concise please?
    Instead of $lang what word should I use? And
   instead of EN_en which one?
 * Thank you
 *  Thread Starter [kunoichi-kyoto](https://wordpress.org/support/users/kunoichi-kyoto/)
 * (@kunoichi-kyoto)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/i-need-to-switch-language-using-programmation/#post-4144514)
 * Hi I have the solution
    <?php $lang = get_bloginfo(‘language’); if($lang==’en-
   US’) echo Categories; elseif($lang==’es-ES’) echo Categorias; elseif($lang==’
   ca’) echo Categories; ?>
 * Thank you

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘I need to switch language using programmation’ is closed to new replies.

 * ![](https://ps.w.org/polylang/assets/icon-256x256.png?rev=3433336)
 * [Polylang](https://wordpress.org/plugins/polylang/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/polylang/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/polylang/)
 * [Active Topics](https://wordpress.org/support/plugin/polylang/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/polylang/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/polylang/reviews/)

## Tags

 * [language](https://wordpress.org/support/topic-tag/language/)
 * [switch](https://wordpress.org/support/topic-tag/switch/)

 * 3 replies
 * 2 participants
 * Last reply from: [kunoichi-kyoto](https://wordpress.org/support/users/kunoichi-kyoto/)
 * Last activity: [12 years, 8 months ago](https://wordpress.org/support/topic/i-need-to-switch-language-using-programmation/#post-4144514)
 * Status: resolved