Commit 550e50b0 authored by Michal Čihař's avatar Michal Čihař

Dropped dependency on msginit for creating new Gettext po files.

This adds last bit of properly updating gettext headers.

Fixes #883
Signed-off-by: default avatarMichal Čihař <michal@cihar.com>
parent 9746afad
......@@ -37,6 +37,7 @@ Released on ? 2015.
* Clarified terminology on strings needing action and not translated strings.
* Support for Python 3.
* Dropped support for Django 1.7.
* Dropped dependency on msginit for creating new Gettext po files.
weblate 2.4
-----------
......
......@@ -770,13 +770,13 @@ class FileFormat(object):
return
@staticmethod
def untranslate_store(store, language):
def untranslate_store(store, language, fuzzy=False):
"""Removes translations from ttkit store"""
store.settargetlanguage(language.code)
for unit in store.units:
if unit.istranslatable():
unit.markfuzzy()
unit.markfuzzy(fuzzy)
if unit.hasplural():
unit.settarget([''] * language.nplurals)
else:
......@@ -887,6 +887,12 @@ class PoFormat(FileFormat):
cls.untranslate_store(store, language)
store.updateheader(
last_translator='Automatically generated',
plural_forms=language.get_plural_form(),
language_team='none',
)
store.savefile(filename)
def merge_header(self, otherstore):
......@@ -948,7 +954,7 @@ class TSFormat(FileFormat):
def create_new_file(cls, filename, language, base):
store = tsfile.parsefile(base)
cls.untranslate_store(store, language)
cls.untranslate_store(store, language, True)
store.savefile(filename)
......
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