I18N: Add $domain argument to translate_user_role().

The text domain is optional and gets passed to `translate_with_gettext_context()`.

Props johnjamesjacoby	.
Fixes #38736.

git-svn-id: https://develop.svn.wordpress.org/trunk@44830 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Dominik Schilling 2019-03-11 20:31:46 +00:00
parent ecfc9872d7
commit e6442466f9

View File

@ -1232,12 +1232,15 @@ function is_textdomain_loaded( $domain ) {
* won't suffer from that problem.
*
* @since 2.8.0
* @since 5.2.0 Added the `$domain` parameter.
*
* @param string $name The role name.
* @param string $name The role name.
* @param string $domain Optional. Text domain. Unique identifier for retrieving translated strings.
* Default 'default'.
* @return string Translated role name on success, original name on failure.
*/
function translate_user_role( $name ) {
return translate_with_gettext_context( before_last_bar( $name ), 'User role' );
function translate_user_role( $name, $domain = 'default' ) {
return translate_with_gettext_context( before_last_bar( $name ), 'User role', $domain );
}
/**