def is_valid_base_for_new(base): ''' Checks whether base is valid. ''' try: tsfile.parsefile(base) return True except Exception: return False
def create_new_file(cls, filename, code, base): store = tsfile.parsefile(base) store.settargetlanguage(code) for unit in store.units: if unit.istranslatable(): unit.markfuzzy() unit.settarget("") store.savefile(filename)
def create_new_file(cls, filename, code, base): store = tsfile.parsefile(base) store.settargetlanguage(code) for unit in store.units: if unit.istranslatable(): unit.markfuzzy() if unit.hasplural(): unit.settarget(['']) else: unit.settarget('') store.savefile(filename)
def create_new_file(cls, filename, language, base): store = tsfile.parsefile(base) cls.untranslate_store(store, language, True) store.savefile(filename)