i18n-polyfill
i18n-polyfill copied to clipboard
Using with AOT
I was wondering if it's possible to use this polyfill with AOT builds? If so then it would be great to know how to do it and also have it mentioned in the readme
Why wouldn't it be possible? There's nothing special to do to use this in AOT, as far as I know
I was just confused because the readme says:
Prepare your application to use i18n, as described on the official documentation, and then provide the TRANSLATIONS file and I18n service in your module or component.
Providing the TRANSLATIONS file and using the raw loader to load the translation file on startup isn't required with AOT so that's why I was unsure if it would work or not.
Yes, this does work for AOT compilation - I've tested it. I needed to import and provide TRANSLATIONS for AOT compilation to work. I agree that it's confusing that the TRANSLATIONS file needs to be provided as that's usually associated with JIT compilation.