Open gryphonmyers opened 7 years ago
I'm ok with it throwing for an unsupported language, not sure if it should fallback to a default tbh.
All languages have been added by contributors as I am a typical ignorant Englishman that speaks only one language! So if a language is not supported here, it's because a user has not found the need to add it.
I totally agree with having a standard for adding these and will add this requirement to the readme. It should follow html language recommendations - https://www.w3.org/International/questions/qa-html-language-declarations - so am happy to go with the list at iana
Re: Czech - I changed the translations property from cs
to cz
recently but forgot to update the readme - so thanks for the heads up.
Re: fallback, my use case is an app-wide locale switcher. I have a locale / language code in my app state and it would be nice if I didn't have to pre-validate this code against your supported list (which should be encapsulated anyway) before passing it into your component. A fallback makes the most sense to me - you could maybe control what the fallback is through another prop?
I think you should be notified of invalid input.
If this feature works for you send in a PR and I'll happily review.
On Wed, Jun 28, 2017 at 7:31 AM, Gryphon Myers notifications@github.com wrote:
Re: fallback, my use case is an app-wide locale switcher. I have a locale / language code in my app state and it would be nice if I didn't have to pre-validate this code against your supported list (which should be encapsulated anyway) before passing it into your component. A fallback makes the most sense to me - you could maybe control what the fallback is through another prop?
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/charliekassel/vuejs-datepicker/issues/191#issuecomment-311569157, or mute the thread https://github.com/notifications/unsubscribe-auth/AC7YFMEFjm_tbGWjhX9knMfHdWuOvq_-ks5sIfNFgaJpZM4OHcTH .
I passed in "cs" (Czech) to see what would happen and got the following errors:
The component should probably fall back to english when it gets an unsupported language.
Edit: I just realized you claim support for Czech. Let me verify this isn't being caused by something wrong on my end.
Edit 2: As far as I can tell I am passing in "cs" correctly. The app seems to be breaking on both "cs" and "pt" (it looks like you support the non-standard "pt-br" but not "pt" in isolation)? My two cents, you should decide if you're supporting locales or languages and not some mix of them, then make everything adhere to http://www.iana.org/assignments/language-subtag-registry/language-subtag-registry