Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
converse.js
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
converse.js
Commits
293a4eee
Commit
293a4eee
authored
Jun 29, 2015
by
Michal Čihař
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Define templates in top level
Signed-off-by:
Michal Čihař
<
michal@cihar.com
>
parent
851212e3
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
6 deletions
+5
-6
weblate/trans/templatetags/translations.py
weblate/trans/templatetags/translations.py
+5
-6
No files found.
weblate/trans/templatetags/translations.py
View file @
293a4eee
...
...
@@ -40,6 +40,9 @@ from weblate.trans.checks import CHECKS
register
=
template
.
Library
()
SPACE_NL
=
u'<span class="hlspace space-nl" title="{0}"></span><br />'
SPACE_TAB
=
u'<span class="hlspace space-tab" title="{0}"></span>'
WHITESPACE_RE
=
re
.
compile
(
r'( +| $|^ )'
)
NEWLINES_RE
=
re
.
compile
(
r'\r\n|\r|\n'
)
TYPE_MAPPING
=
{
...
...
@@ -69,9 +72,7 @@ def fmt_whitespace(value):
# Highlight tabs
value
=
value
.
replace
(
'
\
t
'
,
u'<span class="hlspace space-tab" title="%s"></span>'
%
(
_
(
'Tab character'
)
)
SPACE_TAB
.
format
(
_
(
'Tab character'
))
)
return
value
...
...
@@ -94,9 +95,7 @@ def format_translation(value, language=None, diff=None, search_match=None,
plurals
=
plurals
[:
1
]
# Newline concatenator
newline
=
u'<span class="hlspace space-nl" title="{0}"></span><br />'
.
format
(
_
(
'New line'
)
)
newline
=
SPACE_NL
.
format
(
_
(
'New line'
))
# Split diff plurals
if
diff
is
not
None
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment