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