i18n-polyfill icon indicating copy to clipboard operation
i18n-polyfill copied to clipboard

Using with AOT

Open funxer opened this issue 6 years ago • 3 comments

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

funxer avatar Apr 25 '18 09:04 funxer

Why wouldn't it be possible? There's nothing special to do to use this in AOT, as far as I know

ocombe avatar Apr 25 '18 09:04 ocombe

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.

funxer avatar Apr 25 '18 09:04 funxer

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.

chalcrow avatar Jun 19 '18 01:06 chalcrow