Title: Can&#039;t get language code
Last modified: August 30, 2016

---

# Can't get language code

 *  Resolved [arifamrullah](https://wordpress.org/support/users/arifamrullah/)
 * (@arifamrullah)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/cant-get-language-code/)
 * I need a language code for my web with my custom theme.
    I’ve called the language
   with this on my function : [How to get translation programmatically](http://make.marketpress.com/multilingualpress/2015/02/how-to-get-translations-programmatically/)
   But the result is null, and when I print_r the ($translation), the result is 
   Array(). I’ve set my language site like [this](http://postimg.org/image/liszohb0h/).
   And I have no idea how to call its language code. Please help.
 * Regards, Arif Amrullah from Indonesia.
 * [https://wordpress.org/plugins/multilingual-press/](https://wordpress.org/plugins/multilingual-press/)

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

 *  [David](https://wordpress.org/support/users/dnaber-de/)
 * (@dnaber-de)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/cant-get-language-code/#post-6518244)
 * Hey there,
 * the article you linked mostly describes how to get _translations_. MLP provides
   a function to get the »locale« (language code) for the current blog: `mlp_get_current_blog_language()`
 * An alternative is `mlp_get_blog_language( int $blog_id )` if you want to get 
   the language for any blog by ID.
 *  Thread Starter [arifamrullah](https://wordpress.org/support/users/arifamrullah/)
 * (@arifamrullah)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/cant-get-language-code/#post-6518247)
 * Yup, it works. 😀
    Thanks for the answer, David.

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

The topic ‘Can't get language code’ is closed to new replies.

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

## Tags

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

 * 2 replies
 * 2 participants
 * Last reply from: [arifamrullah](https://wordpress.org/support/users/arifamrullah/)
 * Last activity: [10 years, 9 months ago](https://wordpress.org/support/topic/cant-get-language-code/#post-6518247)
 * Status: resolved