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
76ae4fd7
Commit
76ae4fd7
authored
Mar 30, 2015
by
Weblate
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
7e4a7e85
a2124648
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
6 deletions
+10
-6
weblate/html/translate.html
weblate/html/translate.html
+5
-5
weblate/trans/templatetags/translations.py
weblate/trans/templatetags/translations.py
+5
-1
No files found.
weblate/html/translate.html
View file @
76ae4fd7
...
...
@@ -57,22 +57,22 @@
{% csrf_token %}
{% if antispam %}
<div
id=
"s_content"
>
{{ antispam|crispy }}
</div>
{% endif %}
{% if secondary %}
{% for unit in secondary %}
{% for
secondary_
unit in secondary %}
<div
class=
"form-group"
>
<label>
{{ unit.translation.language }}
</label>
{% format_translation
unit.target
unit.translation.language %}
<label>
{{
secondary_
unit.translation.language }}
</label>
{% format_translation
secondary_unit.target secondary_
unit.translation.language %}
</div>
{% endfor %}
{% endif %}
{% if unit.previous_source and unit.fuzzy %}
<div
class=
"form-group"
>
<label>
{% trans "Source change" %}
</label>
{% format_translation unit.source
unit.translation.language unit.previous_source
%}
{% format_translation unit.source
diff=unit.previous_source num_plurals=unit.translation.language.nplurals
%}
</div>
{% endif %}
<div
class=
"form-group"
>
<label>
{% trans "Source" %}
</label>
{% format_translation unit.source search_match=search_query %}
{% format_translation unit.source search_match=search_query
num_plurals=unit.translation.language.nplurals
%}
</div>
{{ form|crispy }}
</div>
...
...
weblate/trans/templatetags/translations.py
View file @
76ae4fd7
...
...
@@ -78,7 +78,7 @@ def fmt_whitespace(value):
@
register
.
inclusion_tag
(
'format-translation.html'
)
def
format_translation
(
value
,
language
=
None
,
diff
=
None
,
search_match
=
None
,
simple
=
False
):
simple
=
False
,
num_plurals
=
2
):
"""
Nicely formats translation text possibly handling plurals or diff.
"""
...
...
@@ -89,6 +89,10 @@ def format_translation(value, language=None, diff=None, search_match=None,
# Split plurals to separate strings
plurals
=
split_plural
(
value
)
# Show plurals?
if
num_plurals
>
1
:
plurals
=
plurals
[:
1
]
# Newline concatenator
newline
=
u'<span class="hlspace" title="{0}">↵</span><br />'
.
format
(
_
(
'New line'
)
...
...
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