Tag Info

New answers tagged

1

I maintain WordPress Bengali project and yesterday I pushed the 3.9 translation update from bn.wordpress.org. You are right, there are no 3.9.x branch there so it's pretty much not clear to me as well. Here's how it works: we should always translate from the Dev version. When a new release comes, there is a SVN revision for that WordPress release. We just ...


0

The translate_user_role function is just a wrapper for translate_with_gettext_context, defining the context 'User role'. In this last function, there is the filter hook gettext_with_context, which provides the context as well as the currently used domain. So we could do this: function wpdev_141551_translate_user_roles( $translations, $text, $context, ...


0

Till now, I think that Fulvio's answer's the best one. I'm using that filter even on a multisite setup, with just one line: add_filter('locale', 'set_admin_locale'); function set_admin_locale($locale) { return 'en_US'; } Basically sometimes, and in this case, I use multisite for multi-language sites instead of plugins. Also, I have 1 single theme for ...


0

I'm not sure how you're planning to deal with these terms, but I think you can still use WPML native way to handle terms translations, even though you can't keep the same slug. When you need to deal with a term slug, you can rely on the icl_object_id() function. For instance, suppose you have English as default language, and Italian as a second language. ...


2

There is even a better solution: a filter called plugin_locale. It filters the locale argument before using it in load_plugin_textdomain. add_filter( 'plugin_locale', 'mytheme_plugin_locale' ); function mytheme_plugin_locale() { return 'en_US'; }


1

I'd use printf to put the markup into place after the translation. You can force the order with the right modifiers, but translators are probably smart enough to not really need that. printf( __('The image %sMUST%s be less than %s500 KB%s in size.', CUSTOM_TEXT_DOMAIN), '<em>', '</em>', '<strong>', '</strong>' ) ; I consider ...



Top 50 recent answers are included