[wp-trac] [WordPress Trac] #40172: Search form is not translated.

WordPress Trac noreply at wordpress.org
Sun Nov 26 00:29:06 UTC 2017


#40172: Search form is not translated.
---------------------------+------------------------------
 Reporter:  Dreamsorcerer  |       Owner:
     Type:  defect (bug)   |      Status:  reopened
 Priority:  normal         |   Milestone:  Awaiting Review
Component:  I18N           |     Version:  4.7.3
 Severity:  normal         |  Resolution:
 Keywords:                 |     Focuses:  ui
---------------------------+------------------------------

Comment (by Dreamsorcerer):

 OK, took some more time digging into this and finally got an idea of what
 is breaking. It seems that the parsing of the MO files is incorrect when a
 translation includes a {{{msgctxt}}}.

 In regard to my original bug report, you will see in the eo.po file the
 below translation:

 {{{
 #: wp-includes/general-template.php:213
 msgctxt "placeholder"
 msgid "Search …"
 msgstr "Serĉi …"
 }}}

 What happens is that at {{{wp-includes/pomo/mo.php:265}}}, {{{$original}}}
 is set to {{{placeholder\x04Search …}}}.

 Which means that calling {{{__('Search …')}}} fails, as that key
 does not exist, however {{{__('placeholder\x04Search …')}}} works
 correctly.

 Likewise, Contact and Blog appear under {{{Theme starter
 content\x04Contact}}} and {{{Theme starter content\x04Blog}}}
 respectively.

 So, this explains why random parts of my site are not translated. It may
 also explain why you were unable to reproduce the issue, if your theme is
 using the {{{Search}}} string, as that translation works correctly for me.
 So, please confirm if you are able to reproduce the issue by testing if
 {{{__('Search …')}}} return the correct translation: {{{Serĉi
 …}}}.

 This latest debugging session was done on WP 4.9.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/40172#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list