Angular Vienna, I18N and translations using Angular's dependency injection, January 2020

preview_player
Показать описание
Talk by Vojtech Mašek:
I18N and translations using Angular's dependency injection and lazy-loading

If you've ever had a problem with the maintenance of i18n and translations, there is a simple solution. TypeScript, dependency injection and lazy loading as an elegant way to have your project translated and under control.

There is a solution for easy and maintainable i18n for Angular projects.

TypeScript knows all we need and dependency injection will provide the way, with just a little bit of router’s elegant lazy-loading.
Translations have a type definition inferred from a default translation, data is injected via dependency injection provider.

Each site mutation is lazy loaded as a module that consists of an imported wrapped site module (shared for all mutations) and its own i18n stuff.
Рекомендации по теме
Комментарии
Автор

Dependency injection isn't as good as imports, the issue there is the compiler can't track dependencies the same, because it relies on mutation

striker