Translates role name.
Description
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
$namestringrequired- The role name.
$domainstringoptional- Text domain. Unique identifier for retrieving translated strings.
Default'default'.Default:
'default'
Source
* @since 5.2.0 Added the `$domain` parameter.
*
* @param string $name The role name.
Always make sure that the first letter of
$nameis Capitalized!For example this will fail and return the original
$namebut this one will return the translation of
$name