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.
Built from https://develop.svn.wordpress.org/trunk@44830


git-svn-id: http://core.svn.wordpress.org/trunk@44662 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Dominik Schilling 2019-03-11 20:32:52 +00:00
parent 7d952a7930
commit 24e2829eb9
2 changed files with 7 additions and 4 deletions

View File

@ -1232,12 +1232,15 @@ function is_textdomain_loaded( $domain ) {
* won't suffer from that problem. * won't suffer from that problem.
* *
* @since 2.8.0 * @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. * @return string Translated role name on success, original name on failure.
*/ */
function translate_user_role( $name ) { function translate_user_role( $name, $domain = 'default' ) {
return translate_with_gettext_context( before_last_bar( $name ), 'User role' ); return translate_with_gettext_context( before_last_bar( $name ), 'User role', $domain );
} }
/** /**

View File

@ -13,7 +13,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '5.2-alpha-44829'; $wp_version = '5.2-alpha-44830';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.