Commit 0046ac81 authored by Weblate's avatar Weblate

Merge remote-tracking branch 'origin/master'

parents 011f0ee8 99fcf0a7
...@@ -39,10 +39,22 @@ strings in the message: ...@@ -39,10 +39,22 @@ strings in the message:
``%(language)s`` ``%(language)s``
Language code Language code
``%(language_name)s``
Language name
``%(subproject)s`` ``%(subproject)s``
Subproject name Subproject name
``%(project)s`` ``%(project)s``
Project name Project name
``%(total)s``
Total strings count
``%(fuzzy)s``
Fuzzy strings count
``%(fuzzy_percent)s``
Fuzzy strings percent
``%(translated)s``
Translated strings count
``%(translated_percent)s``
Translated strings percent
There are also additional features which you can control, like automatic There are also additional features which you can control, like automatic
pushing of changes (see also :ref:`push-changes`), merge or rebase pushing of changes (see also :ref:`push-changes`), merge or rebase
......
...@@ -18,6 +18,7 @@ Relased on ? 2012. ...@@ -18,6 +18,7 @@ Relased on ? 2012.
* Improved translation locking handling. * Improved translation locking handling.
* Show code snippets for widgets in more variants. * Show code snippets for widgets in more variants.
* Indicate failing checks or fuzzy strings in progressbars. * Indicate failing checks or fuzzy strings in progressbars.
* More options for formatting commit message.
weblate 1.3 weblate 1.3
----------- -----------
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
{% load url from future %} {% load url from future %}
<link rel="stylesheet" type="text/css" href="{% get_media_prefix %}css/style.css" /> <link rel="stylesheet" type="text/css" href="{% get_media_prefix %}css/style.css" />
<link rel="stylesheet" type="text/css" href="{% get_media_prefix %}css/custom-theme/jquery-ui-1.9.2.custom.css" /> <link rel="stylesheet" type="text/css" href="{% get_media_prefix %}css/custom-theme/jquery-ui-1.9.2.custom.min.css" />
<script src="{% get_media_prefix %}js/jquery-1.8.3.min.js" type="text/javascript"></script> <script src="{% get_media_prefix %}js/jquery-1.8.3.min.js" type="text/javascript"></script>
<script src="{% get_media_prefix %}js/jquery-ui-1.9.2.custom.min.js" type="text/javascript"></script> <script src="{% get_media_prefix %}js/jquery-ui-1.9.2.custom.min.js" type="text/javascript"></script>
<script src="{% get_media_prefix %}js/jquery.autogrow-textarea.js" type="text/javascript"></script> <script src="{% get_media_prefix %}js/jquery.autogrow-textarea.js" type="text/javascript"></script>
......
This diff is collapsed.
...@@ -195,7 +195,17 @@ def validate_repoweb(val): ...@@ -195,7 +195,17 @@ def validate_repoweb(val):
def validate_commit_message(val): def validate_commit_message(val):
try: try:
val % {'language': 'cs', 'project': 'Weblate', 'subproject': 'master'} val % {
'language': 'cs',
'language_name': 'Czech',
'project': 'Weblate',
'subproject': 'master',
'total': 200,
'fuzzy': 20,
'fuzzy_percent': 10.0,
'translated': 40,
'translated_percent': 20.0,
}
except Exception as e: except Exception as e:
raise ValidationError(_('Bad format string (%s)') % str(e)) raise ValidationError(_('Bad format string (%s)') % str(e))
...@@ -265,11 +275,10 @@ class Project(models.Model): ...@@ -265,11 +275,10 @@ class Project(models.Model):
) )
# VCS config # VCS config
commit_message = models.CharField( commit_message = models.TextField(
max_length = 200, help_text = ugettext_lazy('You can use format strings for various information, please check documentation for more details.'),
help_text = ugettext_lazy('You can use %(language)s, %(subproject)s or %(project)s for language shortcut, subproject or project names.'),
validators = [validate_commit_message], validators = [validate_commit_message],
default = 'Translated using Weblate.' default = 'Translated using Weblate (%(language_name)s)\n\nCurrently translated at %(translated_percent)s%% (%(translated)s of %(total)s strings)'
) )
committer_name = models.CharField( committer_name = models.CharField(
max_length = 200, max_length = 200,
...@@ -1683,8 +1692,14 @@ class Translation(models.Model): ...@@ -1683,8 +1692,14 @@ class Translation(models.Model):
''' '''
return self.subproject.project.commit_message % { return self.subproject.project.commit_message % {
'language': self.language_code, 'language': self.language_code,
'language_name': self.language.name,
'subproject': self.subproject.name, 'subproject': self.subproject.name,
'project': self.subproject.project.name, 'project': self.subproject.project.name,
'total': self.total,
'fuzzy': self.fuzzy,
'fuzzy_percent': self.get_fuzzy_percent(),
'translated': self.translated,
'translated_percent': self.get_translated_percent(),
} }
def __configure_conf(self, gitrepo, section, key, expected): def __configure_conf(self, gitrepo, section, key, expected):
......
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