add translation logic in i18n directive