Bug 888055

Summary: Newline characters in text flows not obvious enough for translators
Product: [Retired] Zanata Reporter: Hedda Peters <hpeters>
Component: Component-UIAssignee: Patrick Huang <pahuang>
Status: CLOSED CURRENTRELEASE QA Contact: Ding-Yi Chen <dchen>
Severity: medium Docs Contact:
Priority: urgent    
Version: 2.0CC: irooskov, pahuang, zanata-bugs
Target Milestone: ---   
Target Release: 2.2   
Hardware: Unspecified   
OS: Linux   
URL: https://translate.zanata.org/zanata/webtrans/translate?project=subscription-manager&iteration=1.1.X&localeId=de-DE&locale=de#view:doc;doc:keys;search:redeeming%20the
Whiteboard:
Fixed In Version: 2.1-SNAPSHOT (20130108-1249) Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-11-27 03:24:29 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Newline characters not obvious enough none

Description Hedda Peters 2012-12-17 22:41:20 UTC
User-Agent:       Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20100101 Firefox/17.0
Build Identifier: 

Newline characters (\n) within a msgid string are not obvious enough to translators. At the moment they are only represented by the grey numbers to the left of the msgid entry which are easily overlooked.

Reproducible: Always

Steps to Reproduce:
1. Open URL provided, row 457
2. Compare newline characters in msgid and msgstr
Actual Results:  
Newline characters (\n) are only represented by the grey numbers next to the msgid box.

Expected Results:  
Additionally display newline characters (\n) as such within the msgid.

Several translators (including myself) overlooked these "implied" newline characters, omitted them by accident and caused issues with the resulting translation being too long for the UI spot it was intended for... So this seems to be an issue for more people.

Comment 1 Hedda Peters 2012-12-17 22:44:21 UTC
Created attachment 665161 [details]
Newline characters not obvious enough

I actually need to fix this error asap, so the URL provided will not show you a different number of newline characters in msgid and msgstr anymore. 

Screenshot attached though from before fixed translation.

Comment 2 Sean Flanigan 2012-12-21 03:20:29 UTC
There seems to be no way of getting codemirror to show visible newline characters, so I think it's time we investigated the competition: http://ace.ajax.org/

ACE does support visible tabs, and visible newlines.


However, we will need to check on its Unicode support:

https://github.com/ajaxorg/ace/issues/1153 (a similar bug seems to be in codemirror)

https://github.com/ajaxorg/ace/issues/460 (codemirror seems to support variable width)

Comment 3 Patrick Huang 2013-01-01 23:26:45 UTC
posted a question on code mirror group and the answer is, can't get it done completely with code mirror. 
https://groups.google.com/forum/?fromgroups=#!topic/codemirror/tab01KLV3DU
 
to summary:
with code mirror, we can append a symbol at the end of each line (including last line which technically do not have newline character). It's not visible newline but more of an emphasis that the text flow is NOT wrapped but is broken up into lines. It serves the same purpose as line number on the left. Therefore not suitable to use the pilcrow character. This will be a quick fix.

Continue to investigate other editor

Comment 4 Patrick Huang 2013-01-08 00:46:02 UTC
the other syntax highlighting editor - ACE editor does not integrate well with our code. Tried to integrate it myself and also tried to use https://github.com/daveho/AceGWT 
Can't get it to show.

Finally found a solution working in Code Mirror editor. It will display pilcrow for each line it encountered. 

For plain text area editor, at the moment it won't support visible newline. But in source text it will now display visible newline. Plus newly added validation rules to check line numbers. 

Since 2.1 CodeMirror editor under firefox should also support spell check. One less reason to choose plain text area editor :)

Comment 5 Hedda Peters 2013-01-08 00:47:37 UTC
Sounds promising :-) Thanks for all the effort.

Comment 6 Patrick Huang 2013-01-08 00:54:16 UTC
committed into master:
https://github.com/zanata/zanata/commit/bd228970d065507e0ef4e1cd063684b8f9b570f1

Comment 7 Ding-Yi Chen 2013-01-08 05:02:09 UTC
VERIFIED with Zanata version 2.1-SNAPSHOT (20130108-1249)

Comment 8 Sean Flanigan 2013-01-08 05:48:23 UTC
Great work, Patrick!

You should mention the solution you found to the CodeMirror group: https://groups.google.com/forum/?fromgroups=#!topic/codemirror/tab01KLV3DU

(And perhaps someone there can suggest a way of avoiding the slight gap before the pilchard, er, pilcrow, which is seen on empty lines.)

Comment 9 Hedda Peters 2013-02-13 04:23:51 UTC
The implemented solution seems to work somewhat, sometimes, but there are several issues:

I encountered some weird behaviour when playing around with one string that already contained this syntax error. Opening the string in the editor does not seem  to trigger the validation warning, typing normal characters doesn't seem to trigger it either. (see screenshot 1)

Only when I entered another line break character into the translation the validation warning appears. But then the warning is somewhat unexpected (see screenshot 2) The msgid contains 3 lines, the translation contains 2 lines - yet the warning tells me that the translation contains too many lines. 

Occasionally by clicking in and out of this particular string, the msgid disappears and shows only an empty box, with two scroll bars at the right hand side. Not sure if that's related, or how exactly to reproduce. (screenshot 3)

All this only works with CodeMirror enabled, the newline characters are not displayed when CodeMirror is not selected - is that expected?

Comment 16 Sean Flanigan 2013-11-27 03:14:51 UTC
Closing VERIFIED bugs for Zanata versions <= 3.1.

Comment 17 Sean Flanigan 2013-11-27 03:16:30 UTC
Closing VERIFIED bugs for Zanata versions <= 3.1.

Comment 18 Sean Flanigan 2013-11-27 03:18:18 UTC
Closing VERIFIED bugs for Zanata versions <= 3.1.

Comment 19 Sean Flanigan 2013-11-27 03:24:29 UTC
Closing VERIFIED bugs for Zanata versions <= 3.1.

Comment 20 Sean Flanigan 2013-11-27 03:33:00 UTC
Closing VERIFIED bugs for Zanata versions <= 3.1.

Comment 21 Sean Flanigan 2013-11-27 03:35:15 UTC
Closing VERIFIED bugs for Zanata versions <= 3.1.