Profile field options are stored as strings, each option delimited by a newline.

When you go to translate such a string of options, they're displayed by default on a single line without any line breaks. This caused some confusion here: #1101328: Problem translating profile fields

That confusion could have been avoided if the original text maintained its newlines. I'm proposing this patch to fix this minor UX issue.

Comments

Status: Needs review » Needs work

The last submitted patch, maintain_newlines_in_original_text.patch, failed testing.

iamEAP’s picture

Status: Needs work » Needs review
StatusFileSize
new485 bytes

Whoops. Here's the same against the dev branch.

thiagomp’s picture

Can you please provide a description on how to reproduce this problem?

Thanks,

Thiago

iamEAP’s picture

StatusFileSize
new25.21 KB

Create a field of selectable options. Rather than using standard taxonomy, just use a newline delimited list of strings, e.g...

Aerospace & Defense
Agriculture & Mining
Associations & Non-profits
Etc.

Then, attempt to translate this list of options. The "Edit string" page shows the list of options with no newlines between them, but the textfield below expects the newline. Very unintuitive. See:

thiagomp’s picture

Status: Needs review » Reviewed & tested by the community

Thanks for the explanation iamEAP.
Now I could reproduce the problem.

I really enjoyed your idea and it really improves the UX.

I've noticed that you suppressed the wordwrap() function, so I managed to execute some tests considering a really long option for this type of field (and for other type of fields too).
The result was nice, once the browser would take care of the line breaking.

After all that, I recommend the patch to be merged into the main code.

iamEAP’s picture

Thanks for the review, thiagomp.

I'll also add that the interface for this in D7 is completely different, so there's no need to write it for D7, then backport. It's fine staying here in the D6 queue.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 2: maintain_newlines_in_original_text-1358862-2.patch, failed testing.

Status: Needs work » Closed (outdated)

Automatically closed because Drupal 6 is no longer supported. If the issue verifiably applies to later versions, please reopen with details and update the version.