i18n-polyfill
i18n-polyfill copied to clipboard
Translate text out of angular scope
Hi,
we have few classes which contain only data, and call them Entities. Sometimes they contain text which need to be translated but they are out of angular component/modules scope. They are createded in services as response from API and data are transfered to Entitie and List.
Its not possible for every entities manualy link I18n to constructor.
Your I18n service is provided in root module. We can simply after init of this service/module store this service to static function/variable/static class as translator, which in final result we can use for static transalte in this Entities.
But problem is extractor. Is any workaroud how we can extract this text, which using forwarded service in static variable?
Or create anotation which bring from metadatas I18n service for after init static translate text.