[wp-meta] [Making WordPress.org] #5923: Use `prepare_original()` in editor for strings with plurals as well

Making WordPress.org noreply at wordpress.org
Thu Oct 7 10:03:59 UTC 2021


#5923: Use `prepare_original()` in editor for strings with plurals as well
--------------------------------------+-------------------------
 Reporter:  vladytimy                 |      Owner:  (none)
     Type:  enhancement               |     Status:  new
 Priority:  normal                    |  Milestone:
Component:  Translate Site & Plugins  |   Keywords:  2nd-opinion
--------------------------------------+-------------------------
 In the `translation-row-preview.php` template, `prepare_original()` is
 used for strings **both with a plural and without**.
 [https://github.com/WordPress/wordpress.org/blob/master/wordpress.org/public_html
 /wp-content/plugins/wporg-gp-customizations/templates/translation-row-
 preview.php#L29-L41 See template.]

 In the `translation-row-editor.php` template, `prepare_original()` is used
 ** only for strings with no plural**.
 [https://github.com/WordPress/wordpress.org/blob/master/wordpress.org/public_html
 /wp-content/plugins/wporg-gp-customizations/templates/translation-row-
 editor.php#L81-L98 See template.]

 So, the editor for strings with plural are missing this filter that:
 - replaces new lines and tab characters with visual symbols. See
 [https://translate.wordpress.org/projects/wp-plugins/test-plugin-3/dev/en-
 gb/default/?filters%5Boriginal_id%5D=9692098 this example here] where only
 the preview has them, but not the editor.
 - wraps non-translatable items with a notranslate class that can be used
 by various extensions or even GP in the future.


 Unless there is a valid reason not to do so, I suggest we apply
 `prepare_original()` to plural originals in editor as well.

 Note: Although this inconsistency is present in GlotPress itself as well,
 we use a custom template for `translation-row-editor.php` so the fix for
 translate.WordPress.org is here. A similar issue will be opened for
 GlotPress, but we need to fix this on our side.

-- 
Ticket URL: <https://meta.trac.wordpress.org/ticket/5923>
Making WordPress.org <https://meta.trac.wordpress.org/>
Making WordPress.org


More information about the wp-meta mailing list