Title: Fix $lang missing error in YARPP_Cache.php
Last modified: August 30, 2016

---

# Fix $lang missing error in YARPP_Cache.php

 *  [Goce Mitevski](https://wordpress.org/support/users/gocemitevski/)
 * (@gocemitevski)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/fix-lang-missing-error-in-yarpp_cachephp/)
 * If WPLANG is not defined $lang in YARPP_Cache.php is not initialized properly
   and an error is caused.
 * FIXED code below:
 *     ```
       if (defined('WPLANG')) {
       	switch ( substr(WPLANG, 0, 2) ) {
       		case 'de':
       			$lang = 'de_DE';
       			break;
       		case 'it':
       			$lang = 'it_IT';
       			break;
       		case 'pl':
       			$lang = 'pl_PL';
       			break;
       		case 'bg':
       			$lang = 'bg_BG';
       			break;
       		case 'fr':
       			$lang = 'fr_FR';
       			break;
       		case 'cs':
       			$lang = 'cs_CZ';
       			break;
       		case 'nl':
       			$lang = 'nl_NL';
       			break;
       		default:
       			$lang = 'en_US';
       			break;
       	}
       }
       else{
       	$lang = 'en_US';
       }
       ```
   
 * [https://wordpress.org/plugins/yet-another-related-posts-plugin/](https://wordpress.org/plugins/yet-another-related-posts-plugin/)

The topic ‘Fix $lang missing error in YARPP_Cache.php’ is closed to new replies.

 * ![](https://ps.w.org/yet-another-related-posts-plugin/assets/icon-256x256.png?
   rev=2549977)
 * [YARPP - Yet Another Related Posts Plugin](https://wordpress.org/plugins/yet-another-related-posts-plugin/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/yet-another-related-posts-plugin/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/yet-another-related-posts-plugin/)
 * [Active Topics](https://wordpress.org/support/plugin/yet-another-related-posts-plugin/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/yet-another-related-posts-plugin/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/yet-another-related-posts-plugin/reviews/)

## Tags

 * [initialization](https://wordpress.org/support/topic-tag/initialization/)
 * [YARPP](https://wordpress.org/support/topic-tag/yarpp/)

 * 0 replies
 * 1 participant
 * Last reply from: [Goce Mitevski](https://wordpress.org/support/users/gocemitevski/)
 * Last activity: [10 years, 3 months ago](https://wordpress.org/support/topic/fix-lang-missing-error-in-yarpp_cachephp/)
 * Status: not resolved