Closed ms-studio closed 7 years ago
The WP_User_Taxonomy
class accepts a 4th parameter for $labels
which is used to override the singular/plural setup. This doesn't help the 2 core group-type's labels, but does mean anyone who currently needs this to work more accurately has a work-around until I can look at this more.
Sorry for the delay on this. I've looked at it again, and based on my current understanding of the GetText API, I believe my comment above is probably still the best approach.
Also, new in WordPress 4.4 is a register_taxonomy_args
filter, that will allow just-in-time filtering of the labels, as well as all of the other attributes.
Thanks for opening this issue. If I've misunderstood or if there's a better approach, please reopen as needed.
I submitted a pull request some time ago to make the labels on Group edit pages translatable. In the meantime, I noticed that this solution isn't perfect and causes issues for some languages.
Currently, the labels for Group edit pages are defined in class-user-taxonomy:
This is problematic for languages with more intricate grammar, because the adjectives (Popular, All, Parent) may need to differ according to the gender of the taxonomy (in languages that support male/female nouns).
For example in French, if one group is "Groupes" (male), and the other "Classes" (female), the 'All %s' label must translate as:
When registering a WordPress taxonomy with
register_taxonomy()
, those labels are defined for each taxonomy, which allows them to be gender-specific.In this plugin,
WP_User_Taxonomy
simplifies the process by only specifying 'singular' and 'plural', which seems to make things easier... but the side-effect is that we get the grammar wrong for some languages :-/How to fix it?
It should be possible to define the labels explicitly for each
WP_User_Taxonomy
object, the same way as withregister_taxonomy()
.Possibly, the current situation could work as a fallback, so there's less tedious repetition for gender-neutral languages.