def __create_translation_migration(self):
migrations_dir = os.path.join(self.BASE_DIR, self.app_name + "<STR_LIT>")<EOL>dependency_migration = os.path.basename(max(glob.iglob(migrations_dir + '<STR_LIT>'), key=os.path.getctime)).replace(<EOL>"<STR_LIT>", "<STR_LIT>")<EOL>"""<STR_LIT>"""<EOL>if "<STR_LIT>" in dependency_migration:<EOL><INDENT>dependency_migration = "<STR_LIT>"<EOL><DEDENT>"""<STR_LIT>"""<EOL>call_command('<STR_LIT>', self.app_name, "<STR_LIT>")<EOL>"""<STR_LIT>"""<EOL>last_migration_file = max(glob.iglob(migrations_dir + '<STR_LIT>'), key=os.path.getctime)<EOL>new_lines = self.__create_translation_lines()<EOL>translation_type_lines = self.__create_translation_type_lines()<EOL>if len(dependency_migration) > <NUM_LIT:0>:<EOL><INDENT>dependency_string = "<STR_LIT>" % {'<STR_LIT>': self.app_name,<EOL>'<STR_LIT>': dependency_migration}<EOL><DEDENT>else:<EOL><INDENT>dependency_string = "<STR_LIT>"<EOL><DEDENT>try:<EOL><INDENT>if len(new_lines) > <NUM_LIT:0>:<EOL><INDENT>with open(last_migration_file, '<STR_LIT>') as file:<EOL><INDENT>file.write(self.migration_string % {<EOL>'<STR_LIT>': django.get_version(),<EOL>'<STR_LIT>': datetime.now().strftime('<STR_LIT>'),<EOL>'<STR_LIT>': "<STR_LIT:\n>".join(new_lines),<EOL>'<STR_LIT>': "<STR_LIT:U+002CU+0020>".join('<STR_LIT>'.format(tag) for tag in self.updated_translations),<EOL>'<STR_LIT>': dependency_string,<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': "<STR_LIT:\n>".join(translation_type_lines),<EOL>'<STR_LIT>': "<STR_LIT:U+002CU+0020>".join(<EOL>'<STR_LIT>'.format(tag) for tag in self.updated_translation_types),<EOL>})<EOL><DEDENT><DEDENT>else:<EOL><INDENT>os.remove(last_migration_file)<EOL>self.stdout.write(self.style.NOTICE("<STR_LIT>"))<EOL>return<EOL><DEDENT><DEDENT>except Exception as error:<EOL><INDENT>os.remove(last_migration_file)<EOL>raise error<EOL><DEDENT>else:<EOL><INDENT>self.__update_translation()<EOL>self.stdout.write(self.style.SUCCESS("<STR_LIT>"))<EOL>return<EOL><DEDENT>
Create an empty migration