def init_store_from_template(translation_project, template_store):
 if (translation_project.file_style == 'gnu'):
  target_path = get_translated_name_gnu(translation_project, template_store)
 else:
  target_path = get_translated_name(translation_project, template_store)
 target_dir = os.path.dirname(target_path)
 if (not os.path.exists(target_dir)):
  os.makedirs(target_dir)
 output_file = template_store.file.store
 output_file.settargetlanguage(translation_project.language.code)
 output_file.savefile(target_path)

def init_store_from_template ( translation_project , template_store ) : if ( translation_project . file_style == 'gnu' ) : target_path = get_translated_name_gnu ( translation_project , template_store ) else : target_path = get_translated_name ( translation_project , template_store ) target_dir = os . path . dirname ( target_path ) if ( not os . path . exists ( target_dir ) ) : os . makedirs ( target_dir ) output_file = template_store . file . store output_file . settargetlanguage ( translation_project . language . code ) output_file . savefile ( target_path )
initialize a new file for translation_project using template_store .