New answers tagged

1

The notes to translators aren't required, as far as I can tell, but they will definitely help anyone out who's trying to translate your plugin. You might want to think of them as best practices rather than requirements. As to your second question: Since WordPress 4.6 translations now take translate.wordpress.org as priority and so plugins that are ...


0

Inside the wp_set_script_translations function, you use plugins_url('languages', __FILE__) which is not the correct path. You should use plugin_dir_path(__FILE__) . 'languages/'


1

I have no words 🤦‍♂️ A simple change dirname(plugin_basename(__FILE__)) . '/languages/' inside wp_set_script_translations() function (3rd argument) to plugin_dir_path(__FILE__) . 'languages/' fixed the problem


2

It's also possible to use get_the_archive_title filter in your functions.php: function archive_title_modify( $title ) { return str_replace('Categorie: ', 'Sectie: ', $title); } add_filter('get_the_archive_title', 'archive_title_modify'); The advantage is that it's called only once per page, instead on every translated string as with gettext filter.


1

No, there isn't. The text domain needs to be hard coded, otherwise it can't be read by localization tools which parse the code without executing it. See this note from the Internationalization documentation The text domain should be passed as a string to the localization functions instead of a variable. It allows parsing tools to differentiate between text ...


1

Yes, Recent Tweets Widget is one of the many plugins which their translations are managed through translate.wordpress.org, and this means that upon installing the plugin (*remember, installing and activating are different), WordPress (on your site) will automatically download the plugin's language pack (.po and .mo files) from translate.wordpress.org, and ...


0

You should use : translate_user_role( __('some','textdomains ') ); example : add_role( 'wdcp_developer_role', translate_user_role( __('Developer',$this->textdomains ) ), array( 'read' => true, 'level_12' => true ) ); https://developer.wordpress.org/reference/functions/remove_role/ https://developer.wordpress.org/reference/functions/...


Top 50 recent answers are included