This repository has been archived by the owner on Sep 27, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make sure role labels are translated where the plugin outputs them. F…
…ixes: #157 Note that fixing this ticket brought up another issue, which is that core WP outputs the role in some places. This is out of scope for this commit, so a second ticket was created: #158
- Loading branch information
1 parent
8917cf3
commit 573dd36
Showing
2 changed files
with
19 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
573dd36
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi,
I tried this fix, but it is not working, because localized role labels are not available when
members_register_default_roles
is called. I guess that localization files are loaded during some later hook.So I think that only option is translate role labels when they are printed.
EDIT: WordPress roles are registered in the line 147 in the wp-settings.php file:https://github.com/WordPress/WordPress/blob/5f7a5c1246e3e6a76c5746e27d3b51a5ed51bfce/wp-settings.php#L147
Default textdomain is loaded later, on line https://github.com/WordPress/WordPress/blob/5f7a5c1246e3e6a76c5746e27d3b51a5ed51bfce/wp-settings.php#L396
so translated role labels can't be available when
members_register_default_roles
is called.