WordPress Theme .mo-file won’t load

load_theme_textdomain() needs an absolute path to the directory, so you should set your THEME_URL like so define(“THEME_URL”, get_template_directory()); define(“TRANSLATION_URL”, THEME_URL . “/languages”); It wasn’t working for you because get_bloginfo(“template_url”) is an URL and not an absolute path on your server.

Language file doesn’t work

Can you please try this code in your theme functions.php and tell us what locale do you get on the screen? die( var_dump( get_locale() ) ); If get_locale() value is not ar_AR then that explains why it won’t load your translation. and you may need to adjust/change the locale file name ( the .mo file … Read more

How to change a word in theme?

Some would say it is hard to answer based on the few information you provided. However, the answer may be general enough to cover many more problems similar to your case. First I would install this plugin. Check the screenshots section for more info: https://wordpress.org/plugins/show-current-template/screenshots/ It will provide you the list of files in use. … Read more

How can I see my theme’s text domain?

Your theme’s text domain is defined in your Theme Header in style.css. For example: /* * Plugin Name: My Plugin * Author: Otto * Text Domain: my-plugin */ The text domain should match your theme’s ‘slug’ (ie. the name of the folder where your theme is stored). Read more: https://codex.wordpress.org/I18n_for_WordPress_Developers#Text_Domains

How do I troubleshoot translation issues?

To get ‘Archives’ translated in your text domain you have to load a theme translation .mo file. The file in /wp-content/languages/sv_SE.po will not be used for that. Create a directory languages in your theme. Add the translations for the theme to that directory. I recommend the Codestyling Localization plugin for that. Load the theme translations … Read more

what’s different between _x() and _()

_x() let’s you add a context to your strings. This is useful when you are using the same string in different places. This string may need different translations depending on the language. Your example would be : echo ‘a1 in context 1 ‘ . _x(‘a1’, ‘context1’, ‘mydomain’); echo ‘a1 in context 2 ‘ . _x(‘a1’, … Read more

Translating plugin or locale file

Lots of plugins exist for human translation (as distinct from automatic machine translation). Here’s a blog post that lists and compares some of the best ones: http://www.wpmayor.com/plugin-reviews/best-wordpress-translation-plugins/ In my personal experience, WordPress Multilingual seems to be the most solid one for a long-term commitment: http://wpml.org. They have a few different price options (including free for … Read more