Published on
The datepickers default to showing the dates in English. Depending on which datepicker you are using you can set a local language.
The MooTools datepicker
This one is easy, it comes with Locale files (see below). Set the Date Locale in a Load JS action using the current language tag.
<?php $lang =& JFactory::getLanguage(); $tag = $lang->getTag(); echo "Locale.use('{$tag}');"; ?>
The MonkeyPhysics datepicker
I recommend that you do not use this datepicker unless you are using Joomla! 1.5.
days: days_array, months: months_array
var days_array = new Array(#DAYS#); var months_array = new Array(#MONTHS#);
#DAYS#='Domingo', 'Lunes', 'Martes', 'Miércoles', 'Jueves', 'Viernes', 'Sábado' #MONTHS#='Enero', 'Febrero', 'Marzo', 'Abril', 'Mayo', 'Junio??', 'Julio', 'Agosto', 'Septiembre', 'Octubre', 'Noviembre', 'Diciembre'
- The current list of Date Locales is: "en-US", "ar", "ca-CA", "cs-CZ", "da-DK", "de-DE", "de-CH", "EU", "en-GB", "es-ES", "es-AR", "et-EE", "fa", "fi-FI", "fr-FR", "he-IL", "hu-HU", "it-IT", "ja-JP", "nl-NL", "no-NO", "pl-PL", "pt-PT", "pt-BR", "ru-RU", "ru-RU-unicode", "si-SI", "sv-SE", "uk-UA", "zh-CHS", "zh-CHT".
- If a language you need isn't here you can define a new one (see this post about adding a Turkish tr-TR Date Locale).
- a) On the Form General tab | DateTime Picker config box add these options:
- b) In a Load JS action add the following code to define the days_array and months_array
- c) In the Multi-Language actions define the matching language strings: