How to update a wordpress translation file - wordpress

I want to localize a wordpress plugin and translate it to Persian with POEDIT.
I created the fa_IR.po, fa_IR.mo and all the texts loaded but when I write the translation texts and save the file, nothing happens, and it still shows me english texts in front-end.What should I do?!

Did you properly put your fa_IR.mo file in the /wp-content/languages folder?
And did you properly set define( 'WPLANG', 'fa_IR' ); in wp-config.php?
https://codex.wordpress.org/WordPress_in_Your_Language

Related

WordPress multiple text domain

I am working on a wordpress theme which is based on buildpress and it has its own languages/en_US.po translation file. I would like to add my own custom translations, seperated from the main translation file. so I've added some _e('My string', 'my-domain') and placed languages/my-domain_en_US.po but how can I make Poedit scan only my text domain since i'm scanning the theme and getting all the buildpress's strings. any ideas?

My Wordpress theme not translate

i have a problem.I install stitch theme on wordpress and i want to translate this theme from english to persian.I create fa_IR.mo and fa_IR.po and replace in languages directory of stitch theme.Now add this bottom code to functions.php and header.php :
<?php load_theme_textdomain( 'stitch',get_template_directory().'/languages/fa_IR.mo'); ?>
but my theme still english!!!!Please help me.Where i wrong!!
Thanks alot.
I believe that the stich theme have already included a language file configuration, so you don't have to. BTW, your code should go into functions.php, and the fa_IR.mo part is not needed
All you have to do is, in your wp-config.php, look for this line
define( 'WPLANG', '' );
And change it to
define( 'WPLANG', 'fa_IR' );
This will set your language to persian
Try to use Codestyling Localization - https://wordpress.org/plugins/codestyling-localization/.
You can check if your po/mo files are in proper location, scan your template/plugins for new words for translation, etc. Very useful.

Trouble Translating a WordPress theme

I've created an Arabic website and I am using the zippy theme from MageeWP the things is that I am trying to translate some strings in the theme, but I don't seem to get it working well.
In the theme functions file, there is a specification for the folder location for .PO and .MO files
I created a file ar.mo and put it there, but it still not working, can anybody guide to a clue?
I checked in wp_config.php and indeed the WPLAND is set to ar
I also used the CodeStyling plugin to make the translation, and it didn't work, although the plugin does not problem a .po or .mo files for ONLY ar.
Additionally
the source code of the zippy theme is here: http://themes.svn.wordpress.org/zippy/1.0.9/
Looks like the theme is doing it wrong (simplified code):
define( 'ZIPPY_THEME_BASE_URL', get_template_directory_uri() );
$lang = ZIPPY_THEME_BASE_URL. '/lang';
load_theme_textdomain( 'zippy', $lang );
It's passing an URL and it should be a path, change the load_theme_textdomain line to:
load_theme_textdomain( 'zippy', get_template_directory() . '/lang');
I had a look at the Zippy theme. There are a template called en_US.po inside the lang folder. I had a look at that as well.
If you don't have poedit installed, download poedit now and install it on your computer. Now, make a copy of en_US.po and rename it ar.po. Open ar.po with poedit. Now you can do all your translations in this template. When you're done, just click save in poedit. Poedit will automatically create a ar.mo template when your ar.po is saved.
Note, this is just a quick way of doing it, as there are already a language file available that isn't yet translated.
Hope this helps

translate .po file not working

I install wordpress in english interface.
After that I install theme(alyeska) which translate to Hebrew languege + <html dir="rtl">.
Inside the the theme folder there is lang\alyeska.po
I made some steps to be translation the alyeska.po:
I open the file alyeska.po with Poedit and change onw of the raw and I saved it as he-il.po
I edit the file function.php and add the line <?php load_theme_textdomain('alyeska'); ?> wich I don't know if it is right ('alyeska') or need other value.
I open the file wp-config.php and add the line define ('WPLANG', 'he-il');
The translation theme not working.
What I miss here ?
Many Thx.
try to change this
define ('WPLANG', 'he-il');
to
define ('WPLANG', 'he_IL');
also,
he-il.po
to
he_IL.po

Translation for wordpress theme "Tarski"

I'm using the Tarski theme for a wordpress blog.
I want the blog to be french.
I looked at this page http://tarskitheme.com/help/localisation/, but I can't catch up how to use the .POT file to translate it in french.
I downloaded the file and opened it with geany, made all the translation, ex:
msgid "Search Results"
msgstr "Résultats de recherche
But then can someone explain to me what to do with this file?
I suppose I have to rename it to tarski_3.0-fr_FR.pot, but then where do I put it? Do I have to "compile" it somehow?
Thank you all.
EDIT
It seems that I must ask a question here to find a answer by myself, I just find that I must generate .mo file from the .POT
http://en.wikipedia.org/wiki/GNU_gettext#Translating
But I'm still don't know where to put this file... still searching.
You simply drop the .mo file in the root directory of your theme, and load the text domain. In your case, this last step is already done: the theme already loads its text domains (line 78 in functions.php, the function is load_theme_textdomain).
If you'd like a GUI for editing your translation and generating the .mo, try Poedit.

Resources