Since the role names are in the database and not in the source there are dummy gettext calls to get them into the POT file and this function properly translates them back. The before_last_bar() call is needed, because older installations keep the roles using the old context format: 'Role name|User role' and just skipping the content after the last bar is easier than fixing them in the DB. New installations won't suffer from that problem.
Parameters
$namestring
The role name.
$domainstringoptional
Text domain. Unique identifier for retrieving translated strings. Default 'default'.Default: 'default'
Return
string
Translated role name on success, original name on failure.
Signature, return type and hooks compared across 5 parsed releases.
5.2.0
Added the $domain parameter.from the docblock
2.8.0
Introduced.from the docblock
About this page
Parsed data
Generated from the wordpress-develop 7.0.4 tag, from src/wp-includes/l10n.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.