Commit 5b11db8a authored by Michal Čihař's avatar Michal Čihař

Allow format strings in a message

parent ab432ca3
......@@ -15,6 +15,15 @@ All settings are stored in :file:`settings.py` (as usual for Django).
Message used on each commit Weblate does.
You can use following format strings in the message:
``%(language)s``
Language code
``%(subproject)s``
Subproject name
``%(project)s``
Project name
.. envvar:: ENABLE_HOOKS
Whether to enable anonymous remote hooks.
......
......@@ -801,10 +801,15 @@ class Translation(models.Model):
'''
Commits translation to git.
'''
msg = settings.COMMIT_MESSAGE % {
'language': self.language.code,
'subproject': self.subproject.name,
'project': self.subproject.project.name,
}
gitrepo.git.commit(
self.filename,
author = author.encode('utf-8'),
m = settings.COMMIT_MESSAGE
m = msg
)
if sync:
self.store_hash()
......
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