How to use the polib.POFile.metadata_as_entry function in polib

To help you get started, we’ve selected a few polib examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github wichert / lingua / src / lingua / extract.py View on Github external
def metadata_as_entry(self):
        entry = polib.POFile.metadata_as_entry(self)
        year = time.localtime().tm_year
        header = [u"SOME DESCRIPTIVE TITLE"]
        if self.copyright_holder:
            header.append(u"Copyright (C) %d %s" % (year, self.copyright_holder))
        header.append(
            u"This file is distributed under the same license as the %s package."
            % self.package_name
        )
        header.append(u"FIRST AUTHOR , %d." % year)
        entry.tcomment = u"\n".join(header)
        return entry