[wp-trac] [WordPress Trac] #56059: register_post_type()'s "description" argument can't be translated (gettext)

WordPress Trac noreply at wordpress.org
Sat Jun 25 02:12:57 UTC 2022

#56059: register_post_type()'s "description" argument can't be translated (gettext)
 Reporter:  andreacalligaris   |       Owner:  (none)
     Type:  defect (bug)       |      Status:  new
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  Posts, Post Types  |     Version:  6.0
 Severity:  normal             |  Resolution:
 Keywords:                     |     Focuses:
Changes (by andreacalligaris):

 * keywords:  reporter-feedback =>


 Replying to [comment:1 TobiasBg]:
 > How are you generating the .po and .mo files?
 > Does your software
 It's not about the software, the resulting ''.po'' file is correct, I've
 read it.

 > Can you try using `esc_html( __( ... ) );` instead?
 I can use _e(), anything, it doesn't matter, it never works, I've tried
 everything; If I copy-paste the following code from my first post:
 <?php esc_html__("This is a beautiful description for this post type, but
 sadly it doesn't get translated", 'text_domain');
 and I ''echo'' it in e.g. my sidebar, it gets correctly translated.
 However, when assigned to "description", it is not. It's weird for sure,
 but I cannot see what I'm doing wrong.

Ticket URL: <https://core.trac.wordpress.org/ticket/56059#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform

More information about the wp-trac mailing list