[wp-trac] [WordPress Trac] #51429: Translation not work in get_the_archive_title after changes with translation in context (_x())

WordPress Trac noreply at wordpress.org
Thu Oct 1 10:19:55 UTC 2020


#51429: Translation not work in get_the_archive_title after changes with
translation in context (_x())
--------------------------+-----------------------------
 Reporter:  tomaskavalek  |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:  5.5.1
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 After adding this:

 {{{#!php
 <?php
         if ( $prefix ) {
                 $title = sprintf(
                         /* translators: 1: Title prefix. 2: Title. */
                         _x( '%1$s %2$s', 'archive title' ),
                         $prefix,
                         '<span>' . $title . '</span>'
                 );
         }
 }}}

 There is a big problem with translation, because
 {{{
 '%1$s %2$s'
 }}}
 cannot be translated, even with context, by default.

 This function return original text in English, eg.: Category: Test,
 without prefix translation.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/51429>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list