WeblateOrg / WeblateOrg/weblate
Preserve line-breaks in display of comments (string descriptions)
- Dominant language
- Python
- Stars
- 6.1k
- Forks
- 1.4k
- Avg merge
- 9h 53m
- Merged PRs (30d)
- 395
Description
### Describe the problem
Go to https://hosted.weblate.org/translate/tor/tor-browser/tb-tor-browser-ftl/ar/?checksum=34a0a0c74cb9093c and look at the "Source string description". It is currently shown as:
> User provided bridge dialog. Error shown when the "bridge pass" server does not respond. Here "bridge pass" is a noun: a bridge pass gives users access to some tor bridges. So "pass" is referring to something that gives permission or access. Similar to "token", "permit" or "voucher", but for permanent use rather than one-time.
The original Fluent Group comment is "User provide bridge dialog." and the original Fluent Message comment purposefully includes line breaks after each sentence since they are separate comments. But all the line-breaks are collapsed into whitespace, making each point stand out less.
Note that in Fluent, Group and Resource comments are concatenated with the individual string comments. If the author of the original Fluent file did not include a full-stop at the end of their Group comment, it would blend in. E.g.
```
## Search Feature
# will be used when user has an account
search-with-account = some string
# will be used when the user does not have an account
search-no-account = other string
```
in Weblate the `search-no-account` would be shown with the comment:
> Search Feature will be used when the user does not have an account
which has different meaning.
### Describe the solution you would like
In your web-console change the CSS to include `white-space: pre-line`, and it will change to:
> User provided bridge dialog.
> Error shown when the "bridge pass" server does not respond.
> Here "bridge pass" is a noun: a bridge pass gives users access to some tor bridges.
> So "pass" is referring to something that gives permission or access. Similar to "token", "permit" or "voucher", but for permanent use rather than one-time.
And in my example, it would instead be shown as
> Search Feature
> will be used when the user does not have an account
I can understand that for some use-cases a single comment may be spread across multiple lines for other reasons, but in my own use case I would like each line to be more distinguished. So this could be an option set per component.
### Describe alternatives you have considered
I have been making sure that all of my comment lines end in a full-stop, so there is at least some separation.
### Screenshots
_No response_
### Additional context
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.