PolymerElements / app-localize-behavior

Polymer behaviour to help internationalize your application
48 stars 55 forks source link

3.0 preview dev #130

Closed notwaldorf closed 6 years ago

notwaldorf commented 6 years ago

This was a bit of a gnarly port. Biggest change is that we can't load the IntlMessageFormat library inside the behaviour anymore since it's pre-modules and it doesn't play nicely inside a module.

dlockhart commented 6 years ago

@notwaldorf Have you tried importing directly from intl-messageformat/src/main.js? They seem to be subtly suggesting that's a way to import via ES6 module in their package.json. Couldn't find any mention of it in their documentation though.

Something like:

import IntlMessageFormat from 'intl-messageformat/src/main.js';

I was able to get this ^ to work in a behaviour we have that extends app-localize-behavior, but I had to further set window.IntlMessageFormat = IntlMessageFormat since you're expecting a global variable.

notwaldorf commented 6 years ago

@dlockhart i hadn't, will try!

notwaldorf commented 6 years ago

@bicknellr changes done; also did the @dlockhart fix which worked great.