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

[misc] Print console warning when setting non-existent locales #4085

Merged
merged 5 commits into from Mar 2, 2018

Conversation

Projects
None yet
3 participants
@asulaiman
Contributor

asulaiman commented Jul 26, 2017

Right now if the new locale being set is not available then it fails silently and just uses the existing global locale. A console warning would be useful to notify the user of such a failure.

asulaiman added some commits Jul 26, 2017

Dont silently fail setting new locale when it isnt available
Right now if the new locale being set is not available then it fails silently and just uses the existing global locale. A console warning would be useful to notify the user of such a failure.
@ichernev

This comment has been minimized.

Contributor

ichernev commented Aug 3, 2017

@asulaiman if you want to use console.warn you should do it extremely carefully like here :

(typeof console !== 'undefined') && console.warn) {

@ichernev ichernev changed the title from Dont silently fail setting new locale when it isnt available to [misc] Print console warning when setting non-existant locales Aug 3, 2017

asulaiman added some commits Aug 3, 2017

@asulaiman

This comment has been minimized.

Contributor

asulaiman commented Aug 3, 2017

@ichernev Ive added the console warn checks. Not sure if they are really needed because console console.warn are fairly big dependencies in JS that i dont see going away but i get it that we should be doing this regardless for consistency.

@ichernev

This comment has been minimized.

Contributor

ichernev commented Oct 24, 2017

@asulaiman you're also missing a space after key.

@marwahaha marwahaha changed the title from [misc] Print console warning when setting non-existant locales to [misc] Print console warning when setting non-existent locales Jan 2, 2018

@marwahaha marwahaha added Docs written and removed Needs docs labels Jan 2, 2018

@marwahaha marwahaha merged commit 780e830 into moment:develop Mar 2, 2018

5 checks passed

Base branch Looks good!
Generated files No edits to generated files! :)
Title Your title looks great!
continuous-integration/travis-ci/pr The Travis CI build passed
Details
licence/cla Contributor License Agreement is signed.
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment