سؤال

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

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top