You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Set all date pickers to have French text.
1 $.datepicker.setDefaults( $.datepicker.regional[ "fr" ] );
In reality, this only works if $.datepicker.regional[ "fr" ] is defined, and defined to contain French texts. As explained in the Localization section (below), this typically involves loading an extra JS file.
Note that the files on jQuery's GitHub already call setDefaults, so for a French-only website, that call would be unneeded.
Also, the description is misleading; $.datepicker.regional[ "fr" ] contains options not limited to labels. For example, it sets dateFormat. I recommend either clarifying the effect or removing this example.
By the way, I wonder whether the Localization section shouldn't be above the Utility functions section, since by default, the widget is difficult to use unless all of the audience understands English.
The text was updated successfully, but these errors were encountered:
Hi Scott,
I am also not entirely clear on what exactly should be done myself. What is important is to make sure the reader does not believe the call will necessarily localize to French, and I will consider this ticket as solved no matter which solution addresses that. This could indeed be adressed by adding a note, or simply by removing the example.
I think treating $.datepicker.setDefaults( $.datepicker.regional[ foo ] ); is important. But this should probably be done in the Localization section. It is in fact almost done there already.
There is a cost to keeping the example, even in a non-misleading form. $.datepicker.regional is never defined. For a relatively inexperienced user like me, the call is puzzling - it is not clear that $.datepicker.regional[ foo ] corresponds to $options.
So, at least with a small adaptation of the Localization section, I believe the best solution is removal.
I agree with @Chealer . Localisation should a first citizen in the option list and not require any other js loading. The calendar should come with a default option en_US and users should be able to change on the fly the locale as any other option within the options set.
http://api.jqueryui.com/datepicker/ contains the following code example:
Set all date pickers to have French text.$.datepicker.setDefaults( $ .datepicker.regional[ "fr" ] );
1
In reality, this only works if $.datepicker.regional[ "fr" ] is defined, and defined to contain French texts. As explained in the Localization section (below), this typically involves loading an extra JS file.
Note that the files on jQuery's GitHub already call setDefaults, so for a French-only website, that call would be unneeded.
Also, the description is misleading; $.datepicker.regional[ "fr" ] contains options not limited to labels. For example, it sets dateFormat. I recommend either clarifying the effect or removing this example.
By the way, I wonder whether the Localization section shouldn't be above the Utility functions section, since by default, the widget is difficult to use unless all of the audience understands English.
The text was updated successfully, but these errors were encountered: