Commit 3509fa5a authored by Michal Čihař's avatar Michal Čihař

Management commands for locking/unlocking translations.

parent 7bc5d3c8
...@@ -141,6 +141,19 @@ to date. Additionally you can limit languages to process with ``--lang``. ...@@ -141,6 +141,19 @@ to date. Additionally you can limit languages to process with ``--lang``.
You can either define which project or subproject to update (eg. You can either define which project or subproject to update (eg.
``weblate/master``) or use ``--all`` to update all existing subprojects. ``weblate/master``) or use ``--all`` to update all existing subprojects.
lock_translation <project|project/subproject>
---------------------------------------------
.. django-admin:: lock_translation
Locks given subproject for translating. This is useful in case you want to do
some maintenance on underlaying repository.
You can either define which project or subproject to update (eg.
``weblate/master``) or use ``--all`` to update all existing subprojects.
.. seealso:: :djadmin:`unlock_translation`
pushgit <project|project/subproject> pushgit <project|project/subproject>
------------------------------------ ------------------------------------
...@@ -176,6 +189,19 @@ uptodate. ...@@ -176,6 +189,19 @@ uptodate.
.. seealso:: :ref:`fulltext` .. seealso:: :ref:`fulltext`
unlock_translation <project|project/subproject>
-----------------------------------------------
.. django-admin:: unlock_translation
Unnocks given subproject for translating. This is useful in case you want to do
some maintenance on underlaying repository.
You can either define which project or subproject to update (eg.
``weblate/master``) or use ``--all`` to update all existing subprojects.
.. seealso:: :djadmin:`lock_translation`
setupgroups setupgroups
----------- -----------
......
...@@ -8,6 +8,7 @@ Released on ? 2013. ...@@ -8,6 +8,7 @@ Released on ? 2013.
* Django 1.6 compatibility. * Django 1.6 compatibility.
* No longer maintained compatibility with Django 1.4. * No longer maintained compatibility with Django 1.4.
* Management commands for locking/unlocking translations.
weblate 1.8 weblate 1.8
----------- -----------
......
# -*- coding: utf-8 -*-
#
# Copyright © 2012 - 2013 Michal Čihař <michal@cihar.com>
#
# This file is part of Weblate <http://weblate.org/>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
from trans.management.commands import WeblateCommand
class Command(WeblateCommand):
help = 'locks subproject for editing'
def handle(self, *args, **options):
for subproject in self.get_subprojects(*args, **options):
if not subproject.locked:
subproject.locked = True
subproject.save()
# -*- coding: utf-8 -*-
#
# Copyright © 2012 - 2013 Michal Čihař <michal@cihar.com>
#
# This file is part of Weblate <http://weblate.org/>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
from trans.management.commands import WeblateCommand
class Command(WeblateCommand):
help = 'unlocks subproject for editing'
def handle(self, *args, **options):
for subproject in self.get_subprojects(*args, **options):
if subproject.locked:
subproject.locked = False
subproject.save()
...@@ -288,3 +288,11 @@ class RebuildIndexTest(CheckGitTest): ...@@ -288,3 +288,11 @@ class RebuildIndexTest(CheckGitTest):
all=True, all=True,
clean=True, clean=True,
) )
class LockTranslationTest(CheckGitTest):
command_name = 'lock_translation'
class UnLockTranslationTest(CheckGitTest):
command_name = 'unlock_translation'
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