Refactored embedded i18n in javascript