Commit 851212e3 authored by Michal Čihař's avatar Michal Čihař

Avoid copy/paste errors with whitespace chars.

By inserting them in :before CSS, it's not possible to copy it. This
avoids problems of having these strange chars in translations.

Fixes #764
Signed-off-by: default avatarMichal Čihař <michal@cihar.com>
parent 17a27e33
......@@ -10,6 +10,7 @@ Released on ? 2015.
* Ability to add ACL to anonymous user.
* Improved configurability of import_project command.
* Added CSV dump of history.
* Avoid copy/paste errors with whitespace chars.
weblate 2.3
-----------
......
......@@ -141,6 +141,12 @@ textarea#id_comment {
width: 4em;
text-align: center;
}
.space-tab:before {
content: "→";
}
.space-nl:before {
content: "↵";
}
ins {
background-color: lightgreen;
}
......
......@@ -69,7 +69,7 @@ def fmt_whitespace(value):
# Highlight tabs
value = value.replace(
'\t',
u'<span class="hlspace space-tab" title="%s"></span>' % (
u'<span class="hlspace space-tab" title="%s"></span>' % (
_('Tab character')
)
)
......@@ -94,7 +94,7 @@ def format_translation(value, language=None, diff=None, search_match=None,
plurals = plurals[:1]
# Newline concatenator
newline = u'<span class="hlspace" title="{0}">↵</span><br />'.format(
newline = u'<span class="hlspace space-nl" title="{0}"></span><br />'.format(
_('New line')
)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment