Change / tweak existing wordpress translations

It is better to use a separate file to prevent an overwriting during an upgrade. Filter load_textdomain_mofile and replace the old file with your own: add_filter( ‘load_textdomain_mofile’, function( $mofile, $domain ) { if ( ‘name_of_the_textdomain’ === $domain ) return ‘path_to_your_file.mo’; return $mofile; });

Read text defined under __()

You should look at gettext filter hook which is applied to the translated text by the internationalization functions (__(), _e(), etc.). eg: add_filter( ‘gettext’, ‘my_sanitizer’, 20, 3 ); /** * my_sanitizer * @param string $translated_text the translation * @param string $text the origial text from __() * @param string $domain text domain * @return string … Read more

Replacing strings within posts with the translatable string

Being part of the post content, the string can’t be translated using translation function. You probably need a multilanguage plugin like WPML or Multilingual Press. In that way you’ll be able to have different “version” (one per language supported) of the same post. However, if the only thing you need to translate is the word … Read more

translating wordpress with poedit

Take a closer look at next_post_link and previous_post_link. Specifically; how the function arguments are arranged. Next, take a closer look at translating strings; and how the function arguments are arranged. Now, when you put the two together; you should have something like this: <?php previous_post_link( ‘<span class=”meta-nav”> %link </span>’, __( ‘&#9668; Previous’,’twentyten’), TRUE ); ?> … Read more

‘Trick’ a plugin (WP-Members) to think the blog language has changed for a single page

Yes, sort of. Any localized plugin such as WP-Members runs off of the “locale” that WordPress is set to. This value can be filtered for WP as a whole using the locale filter. But it can also be filtered for plugins using plugin_locale See: https://developer.wordpress.org/reference/hooks/plugin_locale/ To use plugin_locale specific to the text domain for the … Read more

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