Commit 1b46e8a
committed
Improve the default language chain
If the language that is passed in through the options is just a
string, like "en-US" or "pt-BR", Select2 will now try to load the
base language along with the requested language and "en". So
requesting "pt-BR" will try to load "pt-BR", "pt", and "en".
This also catches errors and triggers a warning about not being
able to load the file. This should be a more user friendly error,
and it fixes the problem where Select2 would completely fail to
initialize if a language could not be found.
This closes select2#2934.1 parent 2f4cc19 commit 1b46e8a
7 files changed
Lines changed: 138 additions & 23 deletions
File tree
- dist/js
- src/js/select2
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3662 | 3662 | | |
3663 | 3663 | | |
3664 | 3664 | | |
3665 | | - | |
| 3665 | + | |
| 3666 | + | |
| 3667 | + | |
| 3668 | + | |
| 3669 | + | |
| 3670 | + | |
| 3671 | + | |
| 3672 | + | |
| 3673 | + | |
| 3674 | + | |
3666 | 3675 | | |
3667 | 3676 | | |
3668 | 3677 | | |
| |||
3679 | 3688 | | |
3680 | 3689 | | |
3681 | 3690 | | |
3682 | | - | |
3683 | | - | |
3684 | | - | |
| 3691 | + | |
| 3692 | + | |
| 3693 | + | |
| 3694 | + | |
| 3695 | + | |
| 3696 | + | |
| 3697 | + | |
| 3698 | + | |
| 3699 | + | |
| 3700 | + | |
| 3701 | + | |
| 3702 | + | |
| 3703 | + | |
| 3704 | + | |
| 3705 | + | |
| 3706 | + | |
| 3707 | + | |
3685 | 3708 | | |
3686 | 3709 | | |
3687 | 3710 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3662 | 3662 | | |
3663 | 3663 | | |
3664 | 3664 | | |
3665 | | - | |
| 3665 | + | |
| 3666 | + | |
| 3667 | + | |
| 3668 | + | |
| 3669 | + | |
| 3670 | + | |
| 3671 | + | |
| 3672 | + | |
| 3673 | + | |
| 3674 | + | |
3666 | 3675 | | |
3667 | 3676 | | |
3668 | 3677 | | |
| |||
3679 | 3688 | | |
3680 | 3689 | | |
3681 | 3690 | | |
3682 | | - | |
3683 | | - | |
3684 | | - | |
| 3691 | + | |
| 3692 | + | |
| 3693 | + | |
| 3694 | + | |
| 3695 | + | |
| 3696 | + | |
| 3697 | + | |
| 3698 | + | |
| 3699 | + | |
| 3700 | + | |
| 3701 | + | |
| 3702 | + | |
| 3703 | + | |
| 3704 | + | |
| 3705 | + | |
| 3706 | + | |
| 3707 | + | |
3685 | 3708 | | |
3686 | 3709 | | |
3687 | 3710 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13197 | 13197 | | |
13198 | 13198 | | |
13199 | 13199 | | |
13200 | | - | |
| 13200 | + | |
| 13201 | + | |
| 13202 | + | |
| 13203 | + | |
| 13204 | + | |
| 13205 | + | |
| 13206 | + | |
| 13207 | + | |
| 13208 | + | |
| 13209 | + | |
13201 | 13210 | | |
13202 | 13211 | | |
13203 | 13212 | | |
| |||
13214 | 13223 | | |
13215 | 13224 | | |
13216 | 13225 | | |
13217 | | - | |
13218 | | - | |
13219 | | - | |
| 13226 | + | |
| 13227 | + | |
| 13228 | + | |
| 13229 | + | |
| 13230 | + | |
| 13231 | + | |
| 13232 | + | |
| 13233 | + | |
| 13234 | + | |
| 13235 | + | |
| 13236 | + | |
| 13237 | + | |
| 13238 | + | |
| 13239 | + | |
| 13240 | + | |
| 13241 | + | |
| 13242 | + | |
13220 | 13243 | | |
13221 | 13244 | | |
13222 | 13245 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4090 | 4090 | | |
4091 | 4091 | | |
4092 | 4092 | | |
4093 | | - | |
| 4093 | + | |
| 4094 | + | |
| 4095 | + | |
| 4096 | + | |
| 4097 | + | |
| 4098 | + | |
| 4099 | + | |
| 4100 | + | |
| 4101 | + | |
| 4102 | + | |
4094 | 4103 | | |
4095 | 4104 | | |
4096 | 4105 | | |
| |||
4107 | 4116 | | |
4108 | 4117 | | |
4109 | 4118 | | |
4110 | | - | |
4111 | | - | |
4112 | | - | |
| 4119 | + | |
| 4120 | + | |
| 4121 | + | |
| 4122 | + | |
| 4123 | + | |
| 4124 | + | |
| 4125 | + | |
| 4126 | + | |
| 4127 | + | |
| 4128 | + | |
| 4129 | + | |
| 4130 | + | |
| 4131 | + | |
| 4132 | + | |
| 4133 | + | |
| 4134 | + | |
| 4135 | + | |
4113 | 4136 | | |
4114 | 4137 | | |
4115 | 4138 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
195 | 195 | | |
196 | 196 | | |
197 | 197 | | |
198 | | - | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
199 | 208 | | |
200 | 209 | | |
201 | 210 | | |
| |||
212 | 221 | | |
213 | 222 | | |
214 | 223 | | |
215 | | - | |
216 | | - | |
217 | | - | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
218 | 241 | | |
219 | 242 | | |
220 | 243 | | |
| |||
0 commit comments