How to translate wordpress backend to another language

Just so you know, a Sinhala translation is already in progress. https://si.wordpress.org/ http://wpcentral.io/internationalization/si/ Maybe it would be a good idea to join that team. First, you need to create .po files for the Sinhala translation of WordPress. You’re going to need four of these files. They will be called si_LK.po admin-si_LK.po admin-network-si_LK.po continents-cities-si_LK.po If all … Read more

Programmatically choose language for translation

After looking at the l10n.php I found a way to switch the textdomain using the unload_textdomain function. So I created a simple switch function switch_textdomain( $domain, $newLocale){ /* This will only change the textdomain, not the locale. It will only affect what kind of language will be used for the _e(), _(), __() commands for … Read more

How to use esc_attr__ with custom translation function?

As your function returns the translated string, you could pass the translation function as parameter for esc_attr() and esc_attr_e(): esc_attr__( __myfunction( ‘no_comments’ ) ); esc_attr_e( __myfunction( ‘no_comments’ ) ); But esc_attr__() and esc_attr_e() will perform translation tasks that you don’t need because you handle the translation at your own, so I think it is better … Read more

Trying to localize a Underscores starter theme [duplicate]

Please note how the translation works: The Text Domain should be same in all the places of your theme. On this page you can see the Theme’s text domain setup: load_theme_textdomain( ‘_s’, get_template_directory() . ‘/languages’ ); And on this page (and many in this theme), you can see the implementation of the Text Domain: _e( … Read more

Override translation of 1 word

Since your problem resolves around the fact that the WP theme developers used a function that doesn’t have any hooks so we could easily alter the output, you’re going to have to copy & paste the following code in your functions.php file function human_time_diff( $from, $to = ” ) { if ( empty( $to ) … Read more

WordPress Translations

.po and .mo files are for translating strings in code files. For translating post content use a translation plugin. I’ve used a few and find WPML to be the best in many aspects. Incidentally, they have a built-in workflow for translating both content and strings in code files.

Translating a pager string

You are doing it wrong You should translate the HTML string, not the function When passing strings into functions, like what you are doing, you should use __() which returns the translated string. _e() would echo the string and you would get the raw text and the modified text on output Example of correct usage: … Read more

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