-
Notifications
You must be signed in to change notification settings - Fork 107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Localization, local json, fixes, lint cleanup #41
Conversation
Oh my. Good catch! I think I know what the problem is. I'll see if I can look at it tonight and make the correction. Just in case, which browser are you using? I do my development on a Mac and work mostly in Chrome. |
@richardtallent Thank you for this! I appreciate anyone's help in reviewing this update. I don't have much spare time and I'll admit I'm self-taught in regard to javascript :) I'd like to merge this in once it's tested. |
@Jius, I found the issue -- there was no default value for the "mode" option. I've modified it to default to "event" mode. @kthornbloom, I've tested on Chrome on OS X and Windows, IE11, Safari 9.1.3, iOS Safari, and the Silk browser on my Kindle Fire tablet. I don't have Firefox and don't have access to earlier versions of IE or Android phones, so I can't do any other testing. I patched additional issues I found in testing:
|
Finally had time to dig into this. I tested multiple environments using Browserstack, and aside from some minor alignment issues in IE (which were present before these changes), it looks good! Thanks again for contributing to Monthly! |
So for the localization, you're just adding a class of |
Great! Glad to be able to play a little part. Yes, the So, the developer wouldn't need to set that class themselves, all they need to do is rely on the default locale (or an override To fully support some language other than English or French, they would need to add three CSS rules:
If they don't, the user will get English for those three phrases, but the calendar will still properly localize the weekday and month names. I would have added a few more languages, but other than Spanish, I would be trusting Google Translate. Adding a language adds very few bytes, so hopefully some other users who speak other popular languages can issue PRs and flesh out the native support. Other changes that may need docs: |
How can I use Persian / Jalali Calendar? the localization file, only changes the labels and text, I want to change the calendar itself, is it possible? do you have it in your roadmap? |
Apologies for the massive change set all in one go. I started making a few tweaks so I could use this widget in a personal project I'm building, and the changes kinda got away from me. My primary goals were localization, allowing loading from a local JSON object, fixing some small bugs, moving to em units, and fixing various ESLint rules (I started with all ES5 rules and turned off the ones that didn't seem to add value, the config file is included in this pull). Performance was also a consideration, but I didn't micro-optimize. I made some changes simply for personal taste and legibility, particularly in the CSS, but I hope the changes add value for the most part rather than simply reflecting my personal preferences.
CSS
JavaScript
HTML