Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#5923 closed enhancement (fixed)

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

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


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 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 3 years ago.

Download all attachments as: .zip

Change History (7)

3 years ago

#1 @vladytimy
3 years ago

  • Keywords has-patch added

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

3 years ago

#3 @dd32
3 years 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 years 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 years ago

Thank you!
Just opened an issue upstream as well:

Note: See TracTickets for help on using tickets.