translate datepicker
This commit is contained in:
parent
8a03abec0d
commit
a24d8db4b2
|
@ -343,6 +343,14 @@ OC.Share={
|
||||||
}
|
}
|
||||||
|
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
|
$.datepicker.setDefaults({
|
||||||
|
monthNames: monthNames,
|
||||||
|
monthNamesShort: $.map(monthNames, function(v) { return v.slice(0,3)+'.'; }),
|
||||||
|
dayNames: dayNames,
|
||||||
|
dayNamesMin: $.map(dayNames, function(v) { return v.slice(0,2); }),
|
||||||
|
dayNamesShort: $.map(dayNames, function(v) { return v.slice(0,3)+'.'; }),
|
||||||
|
firstDay: firstDay
|
||||||
|
});
|
||||||
|
|
||||||
$('a.share').live('click', function(event) {
|
$('a.share').live('click', function(event) {
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
|
|
|
@ -2,4 +2,5 @@
|
||||||
$LOCALIZATIONS = array(
|
$LOCALIZATIONS = array(
|
||||||
'date' => '%d.%m.%Y',
|
'date' => '%d.%m.%Y',
|
||||||
'datetime' => '%d.%m.%Y %H:%M:%S',
|
'datetime' => '%d.%m.%Y %H:%M:%S',
|
||||||
'time' => '%H:%M:%S' );
|
'time' => '%H:%M:%S',
|
||||||
|
'firstday' => 0 );
|
||||||
|
|
|
@ -2,4 +2,5 @@
|
||||||
$LOCALIZATIONS = array(
|
$LOCALIZATIONS = array(
|
||||||
'date' => '%B %e, %Y',
|
'date' => '%B %e, %Y',
|
||||||
'datetime' => '%B %e, %Y %H:%M',
|
'datetime' => '%B %e, %Y %H:%M',
|
||||||
'time' => '%H:%M:%S' );
|
'time' => '%H:%M:%S',
|
||||||
|
'firstday' => 0 );
|
||||||
|
|
|
@ -2,4 +2,5 @@
|
||||||
$LOCALIZATIONS = array(
|
$LOCALIZATIONS = array(
|
||||||
'date' => '%e de %B de %Y',
|
'date' => '%e de %B de %Y',
|
||||||
'datetime' => '%e de %B de %Y %H:%M',
|
'datetime' => '%e de %B de %Y %H:%M',
|
||||||
'time' => '%H:%M:%S' );
|
'time' => '%H:%M:%S',
|
||||||
|
'firstday' => 1 );
|
||||||
|
|
|
@ -13,6 +13,9 @@
|
||||||
var oc_current_user = '<?php echo OC_User::getUser() ?>';
|
var oc_current_user = '<?php echo OC_User::getUser() ?>';
|
||||||
var oc_requesttoken = '<?php echo $_['requesttoken']; ?>';
|
var oc_requesttoken = '<?php echo $_['requesttoken']; ?>';
|
||||||
var oc_requestlifespan = '<?php echo $_['requestlifespan']; ?>';
|
var oc_requestlifespan = '<?php echo $_['requestlifespan']; ?>';
|
||||||
|
var dayNames = <?php echo json_encode(array((string)$l->t('Sunday'), (string)$l->t('Monday'), (string)$l->t('Tuesday'), (string)$l->t('Wednesday'), (string)$l->t('Thursday'), (string)$l->t('Friday'), (string)$l->t('Saturday'))) ?>;
|
||||||
|
var monthNames = <?php echo json_encode(array((string)$l->t('January'), (string)$l->t('February'), (string)$l->t('March'), (string)$l->t('April'), (string)$l->t('May'), (string)$l->t('June'), (string)$l->t('July'), (string)$l->t('August'), (string)$l->t('September'), (string)$l->t('October'), (string)$l->t('November'), (string)$l->t('December'))) ?>;
|
||||||
|
var firstDay = <?php echo json_encode($l->l('firstday')) ?>;
|
||||||
</script>
|
</script>
|
||||||
<?php foreach($_['jsfiles'] as $jsfile): ?>
|
<?php foreach($_['jsfiles'] as $jsfile): ?>
|
||||||
<script type="text/javascript" src="<?php echo $jsfile; ?>"></script>
|
<script type="text/javascript" src="<?php echo $jsfile; ?>"></script>
|
||||||
|
|
|
@ -60,7 +60,8 @@ class OC_L10N{
|
||||||
private $localizations = array(
|
private $localizations = array(
|
||||||
'date' => '%d.%m.%Y',
|
'date' => '%d.%m.%Y',
|
||||||
'datetime' => '%d.%m.%Y %H:%M:%S',
|
'datetime' => '%d.%m.%Y %H:%M:%S',
|
||||||
'time' => '%H:%M:%S');
|
'time' => '%H:%M:%S',
|
||||||
|
'firstday' => 0);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* get an L10N instance
|
* get an L10N instance
|
||||||
|
@ -221,6 +222,8 @@ class OC_L10N{
|
||||||
setlocale(LC_TIME, $locales);
|
setlocale(LC_TIME, $locales);
|
||||||
return strftime($this->localizations[$type], $data);
|
return strftime($this->localizations[$type], $data);
|
||||||
break;
|
break;
|
||||||
|
case 'firstday':
|
||||||
|
return $this->localizations[$type];
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue