#54875 closed defect (bug) (invalid)
WordPress not honoring translations of _x() label functions of custom post type
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | I18N | Keywords: | |
Focuses: | Cc: |
Description (last modified by )
_x()
is not working although properly formatted and translated. changing to __()
resolves the issue. More on this issue:
https://stackoverflow.com/questions/58154024/wordpress-not-honoring-translations-of-x-label-functions-of-custom-post-type
Change History (5)
#3
@
23 months ago
to set it:
<?php _x( 'Event Category', 'taxonomy general name', 'my_domain' ),
in the .po file:
#: inc/file.php:120 msgid "Event Category" msgstr "Veranstaltung Kategorie"
I now assume that the context of taxonomy general name needs to be provided, however I have found no documentation on this under https://developer.wordpress.org/reference/functions/_x/
I look forward to finding the error of my ways.
#4
@
23 months ago
- Resolution set to invalid
- Status changed from new to closed
found the issue. _x needs to have the 'context' defined using msgctxt like so:
#: inc/file.php:120 msgctxt "taxonomy general name" msgid "Event Category" msgstr "Veranstaltung Kategorie"
Issues is resolved, just not well documented.
Note: See
TracTickets for help on using
tickets.
Hi there and welcome to WordPress Trac
Could you please share the POT and PO files you have generated?
I assume that the culprit is with those, not WordPress