def is_valid_base_for_new(base): ''' Checks whether base is valid. ''' try: xlifffile.parsefile(base) return True except Exception: return False
def create_new_file(cls, filename, code, base): """Handles creation of new translation file.""" content = xlifffile.parsefile(base) content.settargetlanguage(code) content.savefile(filename)