.mo and .po files for wordpress theme internationalization - wordpress

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.

Related

.Htaccess rewrite URL - Only specific string

We have a current issue with a theme and until the developers of this theme fix the issue we need a quick workaround.
What the theme is doing is outputting the wrong URL for images via Amazon
What it is outputting is:
//images-eu.ssl-images-amazon.com/images/I/51heut5jiDL.jpg
What it should be is:
https://images-eu.ssl-images-amazon.com/images/I/51heut5jiDL.jpg
What we need to do is change all images outputting
What we don't want is the output already duplicating i.e. https://https:// etc etc as we already have images in place that are using the correct output.
Thanks in advance - hopefully the owners of the theme fix this quickly we just need a workaround and think .htaccess is the best bet.
This is on the wordpress platform - theme is kadence / virtue
Thanks

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

default language by polylang plugin not working

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?

Wordpress .mo file not always detected

i translated a wordpress site into simplified chinese, spanish, korean and deutsch with the help of WPML and .po/.mo files on wp-content/languages
All the languages editing went well, and i'm now finalizing the site. I need to translate three last strings. All is working on all languages, except simplified chinese (zh-hans):
I add the three new entries, i generate the .mo file with poedit, and nothing changes. The already translated string stays, and the news doesn't appears.
For testing, i removed the .mo file of simplified chinese, the site remains translated without changes. I'm stuck on it, are the translated strings in the database ? Is there .mo file caching from wordpress ?
Figured out the issue, WPML switched the locale from zh-hans to zh-cn without asking, regenerating .po and .mo.
Using a versioning system, i didn't saw the new files as they were generated by Wordpress.
Hope it helps

Template files not being discovered

I was experiencing an odd problem where blocks were not showing up on a site. After a lot of spelunking I have found that block.tpl.php is not getting called/discovered.
Looking at the suggestions that the theme engine is trying to find it looks like the most general template it will look for is block-MODULE.tpl.php - ie if I set up symlinks for block-block.tpl.php, block-views.tpl.php etc then the content will show.
It just won't find block.tpl.php
So I can kind of make the problem go away, but I'd feel a lot better if I could fix it properly.
Anyone know why (or where) this would happen?
This is drupal 6, with a zen subtheme. zen is in sites/all/themes/ the subtheme is in sites/example.com/themes/.
(it does seem to be finding page.tpl)
PHPTemplate will find the more general templates (e.g. block.tpl.php): you can confirm this behavior by looking in the themes/garland folder which has its own block.tpl.php.
The most common reason for the template engine ignoring your template overrides is because the theme registry has not been reset. You can reset it by going to Site Configuration -> Performance and clicking Clear cached data at the bottom of the page.
Also make sure you've gone through and followed the instructions for sub-theming exactly: missing a step can produce unexpected results:
How to build your own sub-theme (6.x-2.x)
How to build your own sub-theme (6.x-1.x)
Turns out I had added a to the hook_theme() function in template.php for blocks that was pointing to a different location and confusing everyone.
Why I did that is lost to history, but it seems to server no useful purpose.
there should be a version of block.tpl.php in both the theme and subtheme directories.

Resources