fix JS impl of i18n