WordPress.org

Making WordPress.org

Opened 4 months ago

Closed 3 months ago

Last modified 3 months ago

#5923 closed enhancement (fixed)

Use `prepare_original()` in editor for strings with plurals as well

Reported by: vladytimy Owned by: dd32
Milestone: Priority: normal
Component: Translate Site & Plugins Keywords: 2nd-opinion has-patch
Cc:

Description

In the translation-row-preview.php template, prepare_original() is used for strings both with a plural and without. See template.

In the translation-row-editor.php template, prepare_original() is used only for strings with no plural. See template.

So, the editor for strings with plural are missing this filter that:

  • replaces new lines and tab characters with visual symbols. See 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.

Attachments (1)

5923.patch (1.2 KB) - added by vladytimy 4 months ago.

Download all attachments as: .zip

Change History (7)

@vladytimy
4 months ago

#1 @vladytimy
4 months ago

  • Keywords has-patch added

This ticket was mentioned in Slack in #polyglots by evarlese. View the logs.


3 months ago

#3 @dd32
3 months ago

A similar issue will be opened for GlotPress, but we need to fix this on our side.

@vladytimy was an issue opened upstream?

#4 @dd32
3 months ago

  • Owner set to dd32
  • Resolution set to fixed
  • Status changed from new to closed

In 11316:

Translate: Apply prepare_original() to the originals display in the translation editor.

Props vladytimy.
Fixes #5923.

#6 @vladytimy
3 months ago

Thank you!
Just opened an issue upstream as well: https://github.com/GlotPress/GlotPress-WP/issues/1291

Note: See TracTickets for help on using tickets.