Setting WPLANG from a plugin

In wp-includes/l10n.php you will find the function get_locale(). It offers a filter; you can set the language and ignore the constant: function get_locale() { global $locale; if ( isset( $locale ) ) return apply_filters( ‘locale’, $locale ); // WPLANG is defined in wp-config. if ( defined( ‘WPLANG’ ) ) $locale = WPLANG; // If multisite, … Read more

WordPress translation

OMFG that is the most stupid code I saw in core for some time. Don’t follow the comments there, if you want to use a different flavor of open sans just write a plugin that deregister the style and add the one you want to be used instead function replace_open_sans() { wp_deregister_style(‘open-sans’); wp_register_style(‘open-sans’, ‘http://fonts.googleapis.com/css?family=Open+Sans:300’); wp_enqueue_style(‘open-sans’); … Read more

Translate Plugin with french as base language

It is possible, but not good practice. Best thing would be to change all the strings to the english version and then translate it to french. Then you would be up to the standards. Since I do not have enough reputation points to add a comment, I hereby insert the link to a possible duplicate: … Read more

Adding a translation phrase to WordPress Theme

Here is an idea or two that you can pursue here: (CAVEAT: Untested) OPTION 1 In your template file (use a child theme if this is not your own theme), use get_locale in a conditional statement to check which language is set in WPLANG and then dish up the text according to the locale OPTION … Read more

Locale changed but plugin still showing default language

Thanks @toscho — The problem plugin in particular is wp-pagenavi. The backend strings are being translated, however; the frontend remains in default en_US locale. I found this: https://wordpress.org/support/topic/translation-91 To be more specific, the text field values on plugin options page do not get translated so my assumption is that translations are malformed somewhere in the … Read more

Adding theme strings to .PO file

Nevermind, I figured out the solution: the trouble was that POEdit hadn’t picked that there were both singular and plural forms, so I had to manually edit the .PE file to this: msgid “Job Posted” msgid_plural “Jobs Posted” msgstr[0] “” msgstr[1] “”

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