Closed DanielJomphe closed 10 years ago
First of all your code looks good.
For the demo page please clear your browser cache. For me it works on the demo site. Which browser are you trying? Can you please try webshims.activeLang('de');
. And wich version of webshims are you using (see with webshims.version
).
Could you also try to directly link to the french locale:
<script src="/assets/js-webshim/minified/polyfiller.js"></script>
<script src="/assets/js-webshim/minified/shims/i18n/formcfg-fr.js.js"></script>
<script>
$.webshims.activeLang('fr');
$.webshims.polyfill('forms forms-ext');
</script>
Note also, that I recently made some changes to locale loading. (Just in case you made an update (make sure every file is new) or you haven't loaded a stable release).
Oh, now it works (both in 'de' and in 'fr') on your demo page.
As for my page, it continues ignoring the calls.
I'm testing in Chrome 31. Webshims tells me its version is 1.11.4-RC1.
Hmmm, I'm starting to believe it's because Webshims saw Chrome supports everything correctly and thus doesn't need to polyfill anything. Look at this screenshot, doesn't it look like this is Chrome's native widget? On your demo page, the widget is clearly different.
Note that I also tried configuring Webshims to replaceUI and if I remember well, it didn't help. I think I'll try again, although I don't really like the idea of not using the native HTML 5 widgets when they're available. (As long as they do the job!)
Could you also try to directly link to the french locale:
I tried with the following:
<script src="/assets/js-webshim/minified/polyfiller.js"></script>
<script src="/assets/js-webshim/minified/shims/i18n/formcfg-fr.js"></script>
...
but it didn't help.
Note also, that I recently made some changes to locale loading. (Just in case you made an update (make sure every file is new) or you haven't loaded a stable release).
I downloaded the code this afternoon from this link: http://corrupt-system.de/webshims-stable.zip
OK, with replaceUI
, i18n works but then my previous validators no more work, so I suppose I'll need to learn how to validate that field with Webshims.
Thank you very much for your time, aFarkas.
@aFarkas, finally, the manual loading of the l18n file is necessary in my situation! If I remove that line, it no longer works.
@DanielJomphe
I'm not sure, wether I understand everything correctly. Unfortunatley, you can't switch the locale of native datepickers. So if you want to change the locale you have to use replaceUI
for Chrome and Safari mobile. Normally, I'm using replaceUI: true
on Desktop and replaceUI: false
on mobile browsers. About your validation problem. What do you have to do? Can I help. If it's not a bug just some questions, use http://stackoverflow.com/questions/tagged/webshim
aFarkas: to solve my issue, I had to use replaceUI: true
and <script src="/assets/js-webshim/minified/shims/i18n/formcfg-fr.js"></script>
. Without the latter, no l18n changes worked.
If you ever make it so that I no more need to manually load the l18n file(s), I would be very happy if you updated this issue to tell us of the improvement.
As for validation, I've got no issue, just work ahead of me. :)
Thanks again for your time and attention.
How do you use
$.webshims.activeLang('fr');
?After having loaded jQuery and modernizr, I run this on a page:
Webshims definitely kicks in to help this date field work in IE 8 for example, but whatever I do, I can't ever get it to use the
$.webshims.activeLang()
value I setup previously. It always displays the English month names, for example, instead of the French month names.My browser's default locale is English.
I also tried activating the Javascript console on your demo page to see if I could simply call
$.webshims.activeLang('fr');
and see a result, but even there where it works in your demo, my live interactions have no impact on the demo's behavior.