Title: Add language code to include file.
Last modified: August 21, 2016

---

# Add language code to include file.

 *  [huppellepup](https://wordpress.org/support/users/huppellepup/)
 * (@huppellepup)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/add-language-code-to-include-file/)
 * Hi all,
 * I’m using the polylang plugin and want to include a language specific file to
   my page.
 * This works but it’s not language specific yet.
    `<?php include(ABSPATH."/uploads/
   myfile.php"); ?>`
 * I would like to add the language code to the file depending on which language
   I’m in the website.
    `<?php echo get_bloginfo ( 'language' ); ?>`
 * So I get somthing like `myfile_en-US.php`
 * Hoop there is a solution for this.
    Thanks.

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

 *  Moderator [keesiemeijer](https://wordpress.org/support/users/keesiemeijer/)
 * (@keesiemeijer)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/add-language-code-to-include-file/#post-4442998)
 * See this polylang function to get the current language:
    [http://polylang.wordpress.com/documentation/documentation-for-developers/functions-reference/#pll_current_language](http://polylang.wordpress.com/documentation/documentation-for-developers/functions-reference/#pll_current_language)
 *     ```
       <?php
       $lang = pll_current_language();
       if ( 'en' == $lang ) {
       // english
       } elseif ( 'nl' == $lang ) {
       // dutch
       } else {
       // default
       }
       ?>
       ```
   
 *  Thread Starter [huppellepup](https://wordpress.org/support/users/huppellepup/)
 * (@huppellepup)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/add-language-code-to-include-file/#post-4443000)
 * Thanks keesiemeijer,
 * I did some playing and came up which this solution:
    `<?php include(ABSPATH."
   uploads/myfile_" . get_bloginfo ('language') . ".php"); ?>`

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

The topic ‘Add language code to include file.’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [huppellepup](https://wordpress.org/support/users/huppellepup/)
 * Last activity: [12 years, 5 months ago](https://wordpress.org/support/topic/add-language-code-to-include-file/#post-4443000)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
