Closed trading-peter closed 9 years ago
Nice !
Awesome stuff! Sorry for the google io delay :)
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
.
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.
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 ;)
You guys always make an awesome I/O! I hope some day I can afford to come!
No worries. LGTM on the PR. I'll merge and fix up the rest. Thanks for submitting this!
You're welcome! Thanks for giving the opportunity.
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.