default language by polylang plugin not working - wordpress

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

For me it was the Polylang setting
Detect browser language (When the front page is visited, set the
language according to the browser preference).
Found in wp-admin > languages > settings.
Test to uncheck that.

You can set default language by click on star in Polylang 'Languages' page, there will be a star for default language when someone is visiting your website. Also, don't forget to deactivate detect browser language in Polylang 'Settings' page, I hope this will work.
This works fine for me.

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';

This is not a perfect solution but works for me. Change the following line in wp-content/plugins/polylang/frontend/choose-lang.php (Line no 247):
$this->set_language( $language );
to:
$this->set_language( 'ar' ); //set defalt language name.

If someone still having this problem.
I had the same issue with Polylang. I was not able to switch back to English after switching to Arabic. The problem had the easiest solution though. It appeared I forgot to set Site Language of WP itself in Settings>General as English UK (it was set to English US). After I changed that all worked fine.

ok i have solution. not need any code. when you set default language then need to go settings - than - URL modifications settings and mark first (The language is set from content) enter image description here

is someone have still problem with this, i found solution.
Go to DB > ptqsln_options (you have maybe different prefix) > polylang and at end of json is default_lang and change to your language. It works for me.

I had the same issue. My site was built in Mandarain first. Now, I'm adding English, but Polylang keeps saying the default is English and gives me tons of trouble when adding pages. I've figured out how to fix that.
Go to Language Settings, add the correct "default" language. In my case, Chinese. And double click it then you will see a star on it.
You will also see a star on the first row, the English one, which attaches many pages. And it has a star. Double click to unstar it. Now Polylang will think your default will be the only option soon.
Delete the first English one, which has many pages linked to it. (There's no need to back up.) Don't worry, it won't delete any pages. At this time, you only have one language option for Polylang; in my case, Chinese.
Run the setup wizard again. And you will see Polyland says the site's default language is in Chinese. (Or your correct default one.) Congrats! Now finish the setup as normal.
Go back to the Languages, and add English or the correct intended language back. Then you will see this new English has 0 posts attached to it, and the correct Default Lan has all of the posts to it!

Go to Settings > General and change the Site Language to Farsi. That will change the language of the admin part.
Is this what you've been looking for?

Related

Need to Replace Old URL with New URL in Revolution Slider

We have cloned a WordPress site and replaced the urls using Velvet URLs. But the Revolution Slider images url are not replaced yet. Please let me know if any solutions are there.
Thanks in advance.
There is a option in slider settings to change the Replace URL. Please check the screenshot attahced. Hope it helps.
This will work for anybody still looking for this solution. It happened to me that I needed to change the base URL on slider revolution.
Export to PC
Unpack the zip
Open the slider_export.txt in notepad++
find and replace the URL, save and repack
Delete the slider, and import the new one. BINGO!
P.S When changing directory, remember to escape the forward slash "/"
Best regards.
For Slider Revolution 6, the feature has changed place.
You need to get the Domain Switch addon which is available on the main revolution slider page.
Simply browse to addons and look for DS (Domain Switch)
After installing, you'll be able to find/replace the url.
For those who got Revolution Slider as part of a theme and therefore don't have a purchase code.
Use a plugin like Better Search Replace to update the URLs.
Be aware that Revolution Slider escapes certain characters.
So https://example.com/
Is saved as https://example.com/
PhpMyAdmin can accomplish the same thing and you only need to edit the wp_revslider_slides table fields in the column params and layers. Be careful not to forget the escape characters used. I wish search and replace plugin would have a option for this escape setting.
Install Better Search Replace plugin and activate it.
Then search for youroldsite.com and replace with yournewsite.com then select all tables.
NOTE: Make sure that you have checked "Run as Dry run" to see number of changes occures before update the database.

WordPress responsive menu in chinese language

I am using this plugin in my wordpress website.
https://wordpress.org/plugins/wp-responsive-menu/
But when i translate my website in chinese language menu items not showing. Please can you suggets me how i can translate it?
in this plugins, the folder "lang" is empty... It does not use languages. So you need change php files and i recommend you do not do this.
But if you really need change, use sublimetext or other soft or command line for use best function : "search in folder".
Use WMPL[Multilingual Plugin].
Just install this plugin in your website and just translate each and every menu which has been used in English.{you can even Sync the menus to the selected language}.
When you choose your language the menu gets changed to Chinese language and nothing get affected.
You will most probably need to either change the page encoding or if use an approach like in this answer.
(HTML5) cannot display Chinese characters when using UTF-8

NextGEN Gallery still pointing to local drive

I recently moved a wordpress site from my C: drive to a pre-production environment, linux-based machine. The site works well-ish now.
I am using NextGEN galleries there and am using custom gallery theme. This is the problem: After moving, for some reason the galleries refer to the gallery with absolute path of the C: drive, which is obviously not working since this is another machine. I looked into the database to see if there's any value starting with C:\ and indeed I found out several of them and corrected them from C:\xampp\htdocs/wp-content/themes/subspace\nggallery\gallery-subspace.php to wp-content/themes/subspace\nggallery\gallery-subspace.php. However, after refreshing the page which used the gallery in WYSIWYG editor of WP and checking its settings, it stil referred to the template on the C: drive (namely, this is on the "display galleries tab", under "Customize the display settings", it is the value of the "Template" setting).
I checked the database again and there was no path like this in it. I refreshed the page, no difference. I got irritated and went to get a cup of coffee. When I returned, I ran the database query without any modifications again and found this in the wp_options table, option name "_transient_e4ae686b7454a142b0618b1ff15b38f4":
O:8:"stdClass":17:{s:2:"ID";i:4018;s:13:"post_password";s:0:"";s:10:"menu_order";i:0;s:16:"display_settings";a:20:{s:27:"override_thumbnail_settings";s:1:"0";s:15:"thumbnail_width";s:3:"120";s:16:"thumbnail_height";s:2:"90";s:14:"thumbnail_crop";s:1:"1";s:15:"images_per_page";s:2:"24";s:17:"number_of_columns";s:1:"0";s:15:"ajax_pagination";s:1:"1";s:20:"show_all_in_lightbox";s:1:"0";s:23:"use_imagebrowser_effect";s:1:"0";s:17:"show_piclens_link";s:1:"0";s:17:"piclens_link_text";s:14:"[Show PicLens]";s:19:"show_slideshow_link";s:1:"0";s:19:"slideshow_link_text";s:16:"[Show slideshow]";s:8:"template";s:73:"C:\xampp\htdocs/wp-content/themes/subspace\nggallery\gallery-subspace.php";s:19:"use_lightbox_effect";b:1;s:23:"display_no_images_error";i:1;s:18:"disable_pagination";i:0;s:17:"thumbnail_quality";s:3:"100";s:19:"thumbnail_watermark";s:1:"0";s:20:"ngg_triggers_display";s:5:"never";}s:8:"order_by";s:9:"sortorder";s:15:"order_direction";s:3:"ASC";s:10:"exclusions";a:0:{}s:13:"container_ids";a:1:{i:0;i:37;}s:22:"excluded_container_ids";a:0:{}s:9:"sortorder";a:0:{}s:10:"entity_ids";a:0:{}s:7:"returns";s:8:"included";s:20:"maximum_entity_count";s:3:"500";s:6:"source";s:9:"galleries";s:12:"display_type";s:35:"photocrati-nextgen_basic_thumbnails";s:4:"slug";N;s:8:"id_field";s:2:"ID";}
Which, as you can see contains the C:\ path again. I'm 100% positive this wasn't in the database a while ago and repeated the process with the same result (corrected this, waited a minute and it appeared again). Is it possible that this is pulled e.g. from some file?
You can follow the steps mentioned below:
In the wp-admin, go to "Gallery" -> "Other options" then, Click to "Lightbox effects" tab and Click "Show advanced settings" there, you'll find option to change the stylesheet and javascript urls. Change from 'localhost' to your baseurl or ( 127.0.0.1 ). Then save. Thats all.
Let me see if i can help.
Warning : do not try on production, get a dev or appropriate local version running. Also -- can't remember using NextGen, so my advice comes from a desire to do "best" practice in WP.
Easy try : kill cache if used such as JetPack or similar.
Regrading the _transient - should be able to kill -- this link Can I remove transients in the wp_options table of my WordPress install? seems to be dialed in. So if there is a cached element in the mix...bingo.
Next thing is the C:\...stuff rendered in the page source / html? If so, how is it rendered in the page (HTML please)? In other words, what part of the execution is writing C:\... to the page and why? WP has a bad habit of adding the site to the link (grr!). For example image src attribute will have the ``http://``` :
<img src="http://example.com/uploads/whatev..."
And this is written in the wp_posts table (fun migration issues esp if you change url) - so there is a slim possibility that the gallery info with the C drive ref is in the post or similar.
iD10t check: no config setting you missed in gallery? I hope there is not a 3rd party server/storage as #Hareesh mentioned!
Desperation (done this a few times) : dump the MySQL, get a large text editor and search for the string. Remember that weird stuff could be escaped as a " may turn into \" or the use of alternative "safe" quotes. See what can be learned.
Always an option : reinstall in a new WP site and see what/how things go.
If I think of anything else I will add it, but I just spilled how I would try to dissect the issue. GOOD LUCK.
You can use a search and replace tool to replace all C:/... instances with the correct ones.
But be sure to make a full DB backup beforehand, in case something breaks...

.mo and .po files for wordpress theme internationalization

Ok, so I feel like a complete idiot asking this, but I've been looking around and I haven't found a decent answer.
I am using qTranslate as i18n plugin to create a multilingual website.
I have a localized framework/theme with a default.po file. I have built both en_CA.po/.mo and fr_FR.po/.mo files.
What do I do with these and how do I activate them?????
I have tried defining WPLANG in wp-config.php, with no result...
English is already the default one so it works fine, but the French one doesn't apply when switching form english to french... I still get the english text for theme strings (content translates fine)
Thanks for your help!
I figured out it appeared to be a setting in qTranslate that set both locales to en_US and fr_FR instead of en_CA and fr_CA
Thanks.

drupal language switcher unaware of the aliases? switches to node/XX/ instead of LANG/text

I have a big problem with the language switcher,
I have a multi language site that has every article in english and spanish , spanish being the default
so if one article is named :
domain.com/mi-articulo then the english one will be domain.com/en/my-article (using autopath is creating these aliases)
now this works fine if I manualy change the url.. but if I use the language switcher ..the english corespondent it's switches without aliases and Lang prefix
so instead of domain.com/en/my-article it finds domain.com/node/47 so as I have the menu and other things translated it makes drupal unaware of the language switched..
here are the screenshots to better understand what's happening (wierd behaviour)
ver1. spanish
ver2. english
now if i click on english ..look what happends (see url and content like drupal is not aware that this content is nor spanish nor english...because the language switcher doesn't find the aliases)
I had the same problem until I set the default 'Language domain'
in admin/settings/language/edit/en. Now the module is working as expected.
I stumbled upon the same issue today.
All nodes had been imported from another site. All translations were imported, but not the relationship between them, so if you edit a node and check the translations, you may notice that your node doesn't have any given translation.
If this is your issue, you may use the functionality to add existing nodes as translations.
I have the same problem with the language switcher; just cannot get it to do what it's supposed to do. I ended up effectively writing a very simple version of it by adding a block and inserting the following html:
<ul>
<li class="first en">English</li>
<li class="last fr">Français</li>
</ul>
It is limited in that it always takes you back to the homepage after a switch but once that's done, links to other nodes continue correctly with /fr in the url.

Resources