ebidel / i18n-msg

Polymer element for i18n string replacement
https://ebidel.github.io/i18n-msg/
63 stars 21 forks source link

Polymer 1.0 #13

Closed trading-peter closed 9 years ago

trading-peter commented 9 years ago

I tried to migrate your element to polymer ^1.0.0. I also implemented a way to change the source url for the location files.

Other changes: Rename messageDir to messagesUrl (more fitting in my opinion). Added possibility to set the source url for locales on the I18nMsg object. Added observer to automatically update elements if the source url was changed. Fixed typo in '18n-language-ready' event. Property 'language' was misspelled. Fixed bug where new locale files wouldn't get fetched, because the 'fetching_' flag isn't cleared if a request failed before.

merqurio commented 9 years ago

Nice !

ebidel commented 9 years ago

Awesome stuff! Sorry for the google io delay :)

trading-peter commented 9 years ago

Sorry for the indentation chaos. My IDE is sometimes just to automatic... In your comments at the beginning of the file you mention the a getMessage method. Was that ever implemented? I couldn't find it in the code at all. Let me know what I can do better. I'm eager to learn from you guys!

No need to be sorry because of google io delay. This event is like Super Bowl for nerds ;-)

Another question. Wouldn't it be convenient to use iron-ajax for fetching the locale file? To get support for request method's, cookies, auth, and so on... The ajax params for this could also be set by window.I18nMsg.

ebidel commented 9 years ago

Supe bowl indeed!

LGTM. Couple of last bits.

We could potentially move to iron-ajax in the future. I didn't see a whole lot of value using it here because most of the element is JS based and we don't need any declarative bindings in markup.

trading-peter commented 9 years ago

Sorry, I'm not quite sure how you want this.getMsg() to behave. Can you clarify a little bit more. Maybe it's to late for my brain. It's midnight here in germany ;)

trading-peter commented 9 years ago

You guys always make an awesome I/O! I hope some day I can afford to come!

ebidel commented 9 years ago

No worries. LGTM on the PR. I'll merge and fix up the rest. Thanks for submitting this!

trading-peter commented 9 years ago

You're welcome! Thanks for giving the opportunity.