Revision: 1499
http://mrbs.svn.sourceforge.net/mrbs/?rev=1499&view=rev
Author: cimorrison
Date: 2010-10-14 17:04:00 +0000 (Thu, 14 Oct 2010)
Log Message:
-----------
Improved the localisation of the datepicker calendar so that if the broswer
language is set to xx-YY, MRBS will try and use the datepicker xx localisation
if there isn't one for xx-YY.
Modified Paths:
--------------
mrbs/trunk/web/Themes/default/header.inc
Modified: mrbs/trunk/web/Themes/default/header.inc
===================================================================
--- mrbs/trunk/web/Themes/default/header.inc 2010-10-14 16:38:15 UTC (rev
1498)
+++ mrbs/trunk/web/Themes/default/header.inc 2010-10-14 17:04:00 UTC (rev
1499)
@@ -79,7 +79,10 @@
// changed and the regional setting stays as it was before. The reverse
order
// of priority is:
// - the MRBS default language
- // - locales taken from the browser in increasing order of browser preference
+ // - locales taken from the browser in increasing order of browser
preference,
+ // taking for each locale
+ // - the language part only (in case the xx-YY localisation does not
exist)
+ // - the full locale
// - then, if automatic language changing is disabled,
// - the MRBS default language setting again
// - the language part of the override_locale
@@ -109,6 +112,13 @@
// Get the locale in the format that datepicker likes: language lower case
// and country upper case (xx-XX)
$datepicker_locale = locale_format($lang, '-');
+ // First we'll try and get the correct language and then we'll try and
+ // overwrite that with the correct country variant
+ if (strlen($datepicker_locale) > 2)
+ {
+ $datepicker_lang = substr($datepicker_locale, 0, 2);
+ echo
"$.datepicker.setDefaults($.datepicker.regional['$datepicker_lang']);\n";
+ }
echo
"$.datepicker.setDefaults($.datepicker.regional['$datepicker_locale']);\n";
}
if ($disable_automatic_language_changing)
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3.
Spend less time writing and rewriting code and more time creating great
experiences on the web. Be a part of the beta today.
http://p.sf.net/sfu/beautyoftheweb
_______________________________________________
Mrbs-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mrbs-commits