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
81f21683
Commit
81f21683
authored
Jun 04, 2013
by
Weblate
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
5ed10921
b34a71f9
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
4 deletions
+11
-4
trans/formats.py
trans/formats.py
+3
-2
trans/models/translation.py
trans/models/translation.py
+6
-0
trans/views/files.py
trans/views/files.py
+1
-1
weblate/html/translation.html
weblate/html/translation.html
+1
-1
No files found.
trans/formats.py
View file @
81f21683
...
...
@@ -442,11 +442,12 @@ class FileFormat(object):
else
:
return
self
.
store
.
Extensions
[
0
]
def
supports_language_pack
(
self
):
@
classmethod
def
supports_language_pack
(
cls
):
'''
Checks whether backend store supports generating language pack.
'''
return
hasattr
(
self
,
'get_language_pack'
)
return
hasattr
(
cls
,
'get_language_pack'
)
class
AutoFormat
(
FileFormat
):
...
...
trans/models/translation.py
View file @
81f21683
...
...
@@ -386,6 +386,12 @@ class Translation(models.Model, URLMixin):
self
.
subproject
.
template_store
)
def
supports_language_pack
(
self
):
'''
Checks whether we support language pack download.
'''
return
self
.
subproject
.
file_format_cls
.
supports_language_pack
()
@
property
def
store
(
self
):
'''
...
...
trans/views/files.py
View file @
81f21683
...
...
@@ -51,7 +51,7 @@ def download_translation(request, project, subproject, lang):
def
download_language_pack
(
request
,
project
,
subproject
,
lang
):
obj
=
get_translation
(
request
,
project
,
subproject
,
lang
)
if
not
obj
.
s
tore
.
s
upports_language_pack
():
if
not
obj
.
supports_language_pack
():
raise
Http404
(
'Language pack download not supported'
)
filename
,
mime
=
obj
.
store
.
get_language_pack_meta
()
...
...
weblate/html/translation.html
View file @
81f21683
...
...
@@ -59,7 +59,7 @@
{% url 'download_translation' project=object.subproject.project.slug subproject=object.subproject.slug lang=object.language.code as download_url %}
<p>
{% blocktrans %}You can
<a
href=
"{{ download_url }}"
>
download
</a>
file for offline translation.{% endblocktrans %}
</p>
{% if object.s
tore.s
upports_language_pack %}
{% if object.supports_language_pack %}
{% url 'download_language_pack' project=object.subproject.project.slug subproject=object.subproject.slug lang=object.language.code as pack_download_url %}
<p>
{% blocktrans %}You can also
<a
href=
"{{ pack_download_url }}"
>
download
</a>
compiled file to use within the application.{% endblocktrans %}
</p>
{% endif %}
...
...
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