PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Saturday, January 8, 2022

[FIXED] default language by polylang plugin not working

 January 08, 2022     multilingual, wordpress     No comments   

Issue

I installed Polylang Plugin and configed that but I have a problem when I set the default language in Persian language the site loaded in English mode and it is not deference if change default language because in any way in run site loaded by English version. I installed 3 languages: Persian, English, French Wordpress version is 4.1.1 and Polylang Plugin version is 1.8.5 How can I fixed the default language in fa-IR? please help me


Solution

this solution isn't standard! but work for me :)

replace (comment) this line in wp-content/plugins/polylang/frontend/choose-lang.php file (line 185)

$language = $this->options['hide_default'] && ( ( isset( $_SERVER['HTTP_REFERER'] ) && in_array( parse_url( $_SERVER['HTTP_REFERER'], PHP_URL_HOST ), $this->links_model->get_hosts() ) ) || ! $this->options['browser'] ) ?
        $this->model->get_language( $this->options['default_lang'] ) :
        $this->get_preferred_language();  // sets the language according to browser preference or default language

by

$language = 'fa';


Answered By - Arman Feyzi
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home
View mobile version

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing