[wp-trac] [WordPress Trac] #57981: Export .po files error of untranslated strings starting or ending with new lines (\n)

WordPress Trac noreply at wordpress.org
Sat Mar 25 14:39:20 UTC 2023


#57981: Export .po files error of untranslated strings starting or ending with new
lines (\n)
---------------------------+------------------------------
 Reporter:  pedromendonca  |       Owner:  (none)
     Type:  defect (bug)   |      Status:  new
 Priority:  normal         |   Milestone:  Awaiting Review
Component:  I18N           |     Version:  trunk
 Severity:  normal         |  Resolution:
 Keywords:                 |     Focuses:
---------------------------+------------------------------
Changes (by pedromendonca):

 * keywords:  has-patch =>


Comment:

 Another options to what I've suggested in the PR:
 - Leave the `export_enrty()` untouched and make sure the
 `match_begin_and_end_newlines()` checks both for `null` and `''` (empty)
 values.
 - Use `strval( $translation )` to make sure that only strings are sent to
 `match_begin_and_end_newlines()`, cleaning up any `null` $translation
 values.

 But I think it wouldn't be as simpler as I've made in the PR.

 Thoughts on this would be appreciated.

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


More information about the wp-trac mailing list