# # 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 <https://www.gnu.org/licenses/>. # from django.core.exceptions import ValidationError from django.utils.translation import ugettext as _, ugettext_lazy from weblate.trans.checks import CHECKS EXTRA_FLAGS = { v.enable_string: v.name for k, v in CHECKS.items() if v.default_disabled } EXTRA_FLAGS['rst-text'] = ugettext_lazy('RST text') EXTRA_FLAGS['xml-text'] = ugettext_lazy('XML text') EXTRA_FLAGS['skip-review-flag'] = ugettext_lazy( 'Skip review flag when importing') EXTRA_FLAGS['add-source-review'] = ugettext_lazy( 'Add review flag for new source strings') EXTRA_FLAGS['add-review'] = ugettext_lazy( 'Add review flag for new translated strings') IGNORE_CHECK_FLAGS = {CHECKS[x].ignore_string for x in CHECKS} def validate_extra_file(val):
# # 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 django.core.exceptions import ValidationError from django.utils.translation import ugettext as _, ugettext_lazy from weblate.trans.checks import CHECKS EXTRA_FLAGS = { v.enable_string: v.name for k, v in CHECKS.iteritems() if v.default_disabled } EXTRA_FLAGS['rst-text'] = ugettext_lazy('RST text') IGNORE_CHECK_FLAGS = set([CHECKS[x].ignore_string for x in CHECKS]) def validate_repoweb(val): ''' Validates whether URL for repository browser is valid and can be filled in using format string. ''' try: val % {'file': 'file.po', 'line': '9', 'branch': 'master'}
# # 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 django.core.exceptions import ValidationError from django.utils.translation import ugettext as _, ugettext_lazy from weblate.trans.checks import CHECKS EXTRA_FLAGS = { v.enable_string: v.name for k, v in CHECKS.items() if v.default_disabled } EXTRA_FLAGS['rst-text'] = ugettext_lazy('RST text') EXTRA_FLAGS['xml-text'] = ugettext_lazy('XML text') EXTRA_FLAGS['skip-review-flag'] = ugettext_lazy( 'Skip review flag when importing' ) EXTRA_FLAGS['add-source-review'] = ugettext_lazy( 'Add review flag for new source strings' ) EXTRA_FLAGS['add-review'] = ugettext_lazy( 'Add review flag for new translated strings' )