Bug 768802 - Newline validation on leading and trailing string.
Summary: Newline validation on leading and trailing string.
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Zanata
Classification: Retired
Component: Usability
Version: 1.5
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: ---
Assignee: Alex Eng
QA Contact: Ding-Yi Chen
URL:
Whiteboard:
: 746140 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-12-19 02:06 UTC by Alex Eng
Modified: 2012-04-23 04:33 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-04-23 04:33:15 UTC


Attachments (Terms of Use)

Description Alex Eng 2011-12-19 02:06:35 UTC
Description of problem:

Message strings often contain escape sequences like newlines or tabs and any mismatch in their position or number may result in an error to be generated for the translation file.

This story is just for leading and trailing newline. 

This will be for '\n' sequence.

Comment 1 Alex Eng 2011-12-19 04:17:56 UTC
Implemented in 1.5. See https://github.com/zanata/zanata/commit/d4e942d8d1d6420f561d003c6e181e6744894e87

Comment 2 David Mason 2012-01-06 03:16:24 UTC
Does not detect when newlines are present in the target but not the source. Validation should detect these cases given that any mismatch could result in an error.

Properly detects when leading and trailing newlines are present in the source but not the target.

A number of strings in Hibernate Core have a trailing newline followed by 8 spaces. This looks like a trailing newline but is technically just trailing whitespace and is not reported as missing by this validator - it is unclear how this should be treated, this could require an enhancement in the future for validating arbitrary leading/trailing whitespace.

Comment 4 David Mason 2012-01-19 07:35:00 UTC
 - updated to use localisable message strings
 - updated tag order algorithm to detect single moved tag
 - updated printf matching regex to match most standard variable patterns

See
https://github.com/zanata/zanata/commit/f8eaaa0666357c6fe284d6cf4618650ec3513fc0
https://github.com/zanata/zanata/compare/e69ee68374a74eac8535980bc7dd833ba7795b83...030653ed8063238147f95b7219d0838f75150194

Comment 6 David Mason 2012-02-10 04:14:10 UTC
*** Bug 746140 has been marked as a duplicate of this bug. ***


Note You need to log in before you can comment on or make changes to this bug.