From: Bart Visscher Date: Tue, 18 Oct 2011 18:42:22 +0000 (+0200) Subject: Translation of calendar interface X-Git-Tag: v3.0~60^2~63 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=4fe48a50f0ae41f52e2b064f057462ffde324b5d;p=nextcloud-server.git Translation of calendar interface --- diff --git a/apps/calendar/js/calendar.js b/apps/calendar/js/calendar.js index 876465a0e53..f8456c9bc08 100644 --- a/apps/calendar/js/calendar.js +++ b/apps/calendar/js/calendar.js @@ -662,9 +662,21 @@ $(document).ready(function(){ header: false, firstDay: 1, editable: true, + defaultView: defaultView, + timeFormat: { + agenda: 'HH:mm{ - HH:mm}', + '': 'HH:mm' + }, + axisFormat: 'HH:mm', + monthNames: monthNames, + monthNamesShort: monthNamesShort, + dayNames: dayNames, + dayNamesShort: dayNamesShort, + allDayText: allDayText, eventSources: eventSources, viewDisplay: function(view) { $('#datecontrol_date').html(view.title); + $.get(OC.filePath('calendar', 'ajax', 'changeview.php') + "?v="+view.name); } }); $('#oneweekview_radio').click(function(){ diff --git a/apps/calendar/templates/calendar.php b/apps/calendar/templates/calendar.php index d09a5d45a1a..58f61661ce3 100644 --- a/apps/calendar/templates/calendar.php +++ b/apps/calendar/templates/calendar.php @@ -1,5 +1,11 @@
diff --git a/lib/l10n.php b/lib/l10n.php index 54331d44ae4..a5544eb3a27 100644 --- a/lib/l10n.php +++ b/lib/l10n.php @@ -109,6 +109,22 @@ class OC_L10N{ return vsprintf($text, $parameters); } + /** + * @brief Translating + * @param $textArray The text array we need a translation for + * @returns Translation or the same text + * + * Returns the translation. If no translation is found, $textArray will be + * returned. + */ + public function tA($textArray){ + $result = array(); + foreach($textArray as $key => $text){ + $result[$key] = $this->t($text); + } + return $result; + } + /** * @brief getTranslations * @returns Fetch all translations