3

I download a wordpress theme that have a language folder with .po and .mo files, I translate these files with POEdit and replace with originals. but any words in theme didn't translate.

I think I must put files in another place, In theme help I didn't find any useful answer.

please help me.

my files: fa_IR.mo and fa_IR.po in my wp-config: define('WPLANG', 'fa_IR');

I step by step follow Wordpress Codex but it don't change and don't shown my translation.

Ehsan
  • 2,273
  • 8
  • 36
  • 70

1 Answers1

0

In order for Wordpress to properly find your localization files, they have to be in the directory specified in either the second argument of load_theme_textdomain or the third of load_plugin_textdomain.

Be careful that your .mo files must be named exactly like the locale. In your case it has to be fa_IR.mo. In the case of a plugin, the name of the plugin must be prefixed to the locale with a dash, such as: my-plugin-fa_IR.mo.

Sunyatasattva
  • 5,619
  • 3
  • 27
  • 37
  • I have these codes in function.php `add_action('after_setup_theme', 'bellissima_theme_setup'); function bellissima_theme_setup(){ load_theme_textdomain('bellissima', get_template_directory() . '/languages'); }` – Ehsan Jun 07 '13 at 10:03
  • 1
    Then you can just put your `fa_IR.mo` file inside `wp-content/themes/bellissima/languages`. – Sunyatasattva Jun 07 '13 at 10:08
  • 1
    yes I put it there, but no works – Ehsan Jun 07 '13 at 10:11
  • 1
    That's bizarre, also because the `after_setup_theme` is run on every page load. Are you sure your `.mo` file was generated correctly? Not the `.po`, mind you, but the `.mo`. Try to deactivate and reactivate your theme, perhaps. – Sunyatasattva Jun 07 '13 at 10:20
  • deactivate and reactivate worked, thank you – Ehsan Jun 08 '13 at 02:52