New plugin translation does not work

After a heavy investigation, I understood what is happening. The solution to debug this was partially here but there were some php errors that´s why I got a blank page. So, after to test : Which language is called thanks with get_locale() Display WP_LANG_DIR to know where are language files are stored I tried to … Read more

How to translate a WordPress.org plugin?

So to make plugin translatable via translate.wordpress.org you need to add text domain into main plugin’s file: /* * Plugin Name: My Plugin * Author: Plugin Author * Text Domain: my-plugin */ So to make theme translatable via translate.wordpress.org you need to add text domain into main theme’s file: /* * Theme Name: My Theme … Read more

How to add translation for a string

I do not know direct answer on your question but this maybe helps you. You can use plugin Loco translate or you can do it manually like this. _e( ‘Search’, ‘name_tag_of_translation’ ); Then go in wp-content/languages and there define what is you translation, in your case we talk about plugin, so you go: wp-content/languages/plugins and … Read more

I can’t translate text in my plugin using a .mo file, load_plugin_textdomain() function is always false

(Revised answer) The simple answer is because WordPress could not find the MO file, despite the file itself exists (in the plugin’s languages directory). And here’s why: The MO file needs to be named following this format: {text-domain}-{locale}.mo, and {text-domain}-{locale}.po for the PO file. See Loading Text Domain for further information. So you’re trying to … Read more

Custom translation of Month names

Add the following to your existing functions.php file: function ra_change_translate_text( $translated_text ) { if ( $translated_text == ‘January’ ) { $translated_text=”Jan11″; } return $translated_text; } add_filter( ‘gettext’, ‘ra_change_translate_text’, 20 ); If you want to change multiple strings, use this function instead: function ra_change_translate_text_multiple( $translated ) { $text = array( ‘January’ => ‘Jan11’, ‘February’ => ‘Feb22’, … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)