refactored translations in JS