change i18n factory to a function which can be called directily