]> source.dussan.org Git - nextcloud-server.git/commitdiff
translate datepicker
authorscambra <sergio@entrecables.com>
Fri, 21 Sep 2012 06:11:11 +0000 (08:11 +0200)
committerscambra <sergio@entrecables.com>
Fri, 19 Oct 2012 11:56:19 +0000 (13:56 +0200)
core/js/share.js
core/l10n/l10n-de.php
core/l10n/l10n-en.php
core/l10n/l10n-es.php
core/templates/layout.user.php
lib/l10n.php

index de50e53a4411a2db077cef87ac9535d0377dee74..1bc8f55568018897f75d06a15bd9ca00c568415b 100644 (file)
@@ -343,6 +343,14 @@ OC.Share={
 }
 
 $(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) {
                event.stopPropagation();
index 976f8ce3c51aadb7a04f5c7131f6f7aac99cf4d6..d80c3beb2ba54dabc8f3c8da4cc471538ec242a6 100644 (file)
@@ -2,4 +2,5 @@
 $LOCALIZATIONS = array(
        'date' => '%d.%m.%Y',
        'datetime' => '%d.%m.%Y %H:%M:%S',
-       'time' => '%H:%M:%S' );
+       'time' => '%H:%M:%S',
+       'firstday' => 0 );
index 3a050d477ce7a794fd5bb526947560097721ca70..6268214b50336b700bf69f74f61b1a4ad26d3267 100644 (file)
@@ -2,4 +2,5 @@
 $LOCALIZATIONS = array(
        'date' => '%B %e, %Y',
        'datetime' => '%B %e, %Y %H:%M',
-       'time' => '%H:%M:%S' );
+       'time' => '%H:%M:%S',
+       'firstday' => 0 );
index b81464b491a65455a3362af98c3f5491b0b2ba07..8798b24d62f0b8e2a77a501a7fffaaf2e8092bb9 100644 (file)
@@ -2,4 +2,5 @@
 $LOCALIZATIONS = array(
        'date' => '%e de %B de %Y',
        'datetime' => '%e de %B de %Y %H:%M',
-       'time' => '%H:%M:%S' );
+       'time' => '%H:%M:%S',
+       'firstday' => 1 );
index b6d8a7604a2320b9af482079fef9f55069872573..92d47cc51f8fb333e83da47c0f10962b3a8a201c 100644 (file)
@@ -13,6 +13,9 @@
                        var oc_current_user = '<?php echo OC_User::getUser() ?>';
                        var oc_requesttoken = '<?php echo $_['requesttoken']; ?>';
                        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>
                <?php foreach($_['jsfiles'] as $jsfile): ?>
                        <script type="text/javascript" src="<?php echo $jsfile; ?>"></script>
index 26611537175ddcd2ed8fd059fe4ab5eb28c9017b..72ac9e353d8bee8656aad634acf014b84739c347 100644 (file)
@@ -60,7 +60,8 @@ class OC_L10N{
        private $localizations = array(
                'date' => '%d.%m.%Y',
                'datetime' => '%d.%m.%Y %H:%M:%S',
-               'time' => '%H:%M:%S');
+               'time' => '%H:%M:%S',
+               'firstday' => 0);
 
        /**
         * get an L10N instance
@@ -221,6 +222,8 @@ class OC_L10N{
                                setlocale(LC_TIME, $locales);
                                return strftime($this->localizations[$type], $data);
                                break;
+                       case 'firstday':
+                               return $this->localizations[$type];
                        default:
                                return false;
                }