Opened 8 years ago
Closed 6 years ago
#38736 closed enhancement (fixed)
Add $domain parameter to translate_user_role()
Reported by: | johnjamesjacoby | Owned by: | ocean90 |
---|---|---|---|
Milestone: | 5.2 | Priority: | normal |
Severity: | normal | Version: | 4.7 |
Component: | Role/Capability | Keywords: | has-patch |
Focuses: | Cc: |
Description
The translate_user_role()
function currently only works with WordPress's built-in user roles.
For a plugin like bbPress, it cannot pass the bbpress
text domain through to translate_with_gettext_context()
, meaning it's roles can only be translated as part of the default
text domain.
This becomes more of an issue in WordPress 4.7 due to load-order changes between roles & locales.
Patch imminent.
Attachments (2)
Change History (6)
#1
follow-up:
↓ 2
@
8 years ago
Say I have a plugin that uses translate_user_role()
for each of the roles in WordPress, how do I know which textdomain to pass for each role? (I know this is maybe a separate issue from this ticket, but I hadn't considered it before.)
#2
in reply to:
↑ 1
@
8 years ago
Replying to jdgrimes:
Say I have a plugin that uses
translate_user_role()
for each of the roles in WordPress, how do I know which textdomain to pass for each role? (I know this is maybe a separate issue from this ticket, but I hadn't considered it before.)
Good question. Right now, I don't have an answer, since there are no role-groups or domain key.
If a plugin included its own version of this function (as bbPress now does) the problem you describe will still exist for anything trying to loop through all of the roles at once.
Add
$domain
parameter