i18n refactor code