[wp-trac] [WordPress Trac] #51893: Block editor: Serious i18n flaw in block patterns for WP 5.6

WordPress Trac noreply at wordpress.org
Sat Nov 28 19:18:23 UTC 2020


#51893: Block editor: Serious i18n flaw in block patterns for WP 5.6
--------------------------+-----------------------------
 Reporter:  tobifjellner  |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Editor        |    Version:  5.6
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 WordPress RC 1 contains a couple of strings that are almost impossible to
 translate well without specifically figuring out how the underlying code
 is created.

 The reason is:
 **Thou shalt never**
 split a sentence in two parts and then glue them together again after
 translation.

 But that is exactly what happens now in:
 https://build.trac.wordpress.org/browser/branches/5.6/wp-includes/block-
 patterns/large-header-button.php?marks=10#L10

 Code excerpt:
 {{{<strong>" . __( 'Thou hast seen' ) . '</strong><br><strong>' . __(
 'nothing yet' ) . "</strong></p>}}}

 Some examples of why this is a problem:
 - German word order would typically put the verb at the end of the
 sentence.
 - In Swedish, the best translation would split out the negation (from
 string 2) and put it next to the verb.
 - etcetera.

 Even if the translator knows exactly how these strings are used, you still
 have the problem that somewhere else you might have, say, a result of a
 search operation that says "nothing yet". Imagine the German translation
 suddenly having an unexpected verb there, or the Swedish translation
 actually lacking the "no"...

 If you necessarily need to split a sentence that should be translated as a
 whole as two or more separate chunks, then you MUST use _x() and in the
 context string lock this partial translation to this particular case.
 But the best way to handle is to include the whole sentence in the string.
 If you, due to technical limitations, can't allow tags in the translated
 string then we need to find a workaround. But a few formatting tags or br-
 tags in the string to be translated is totally OK, and much-much better
 than this kind of magical brewery.

 H/t @kebbet who alarmed me about this problem. I'll upload his example
 from his test run of the Swedish translation in use.

 During translation, the Victorian-sounding "Thou" prompted me to just keep
 the English text, since I had no clue how it was to be used. But the other
 string "nothing yet" is totally normal, and thus got translated...

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


More information about the wp-trac mailing list