#!/usr/bin/python3 # -*- coding: utf-8 -*- import polib import sys import os.path qcv_metadata={ \ 'PO-Revision-Date': '2013-03-21 10:04+0100', \ 'Language': 'qcv', \ 'Content-Transfer-Encoding': '8bit', \ 'Plural-Forms': 'nplurals=2; plural=(n != 1);', \ 'Project-Id-Version': 'lliurex', \ 'Report-Msgid-Bugs-To': '', \ 'Last-Translator': 'Pilar Embid Giner ', \ 'Language-Team': 'Valencian ', \ 'POT-Creation-Date': '2013-03-21 10:00+0200', \ 'Content-Type': 'text/plain; charset=UTF-8', \ 'MIME-Version': '1.0'\ } if len(sys.argv)>1: try: sys.stdout.write("Working with : " + sys.argv[1] +" ::::: ") po=polib.pofile(sys.argv[1]) id_version=os.path.basename(po.fpath).split(".po")[0] po.metadata=qcv_metadata po.metadata['Project-Id-Version']=id_version po.save() print("Done") except Exception as e: print("FAILED : " + str(e))