Skip to content
Snippets Groups Projects
Commit 4fe48a50 authored by Bart Visscher's avatar Bart Visscher
Browse files

Translation of calendar interface

parent 2e6ec6ce
Branches
No related tags found
No related merge requests found
......@@ -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(){
......
<script type='text/javascript'>
var defaultView = '<?php echo OC_Preferences::getValue(OC_USER::getUser(), 'calendar', 'currentview', 'month') ?>';
var eventSources = <?php echo json_encode($_['eventSources']) ?>;
var dayNames = <?php echo json_encode($l->tA(array('Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'))) ?>;
var dayNamesShort = <?php echo json_encode($l->tA(array('Sun.', 'Mon.', 'Tue.', 'Wed.', 'Thu.', 'Fri.', 'Sat.'))) ?>;
var monthNames = <?php echo json_encode($l->tA(array('January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'))) ?>;
var monthNamesShort = <?php echo json_encode($l->tA(array('Jan.', 'Feb.', 'Mar.', 'Apr.', 'May.', 'Jun.', 'Jul.', 'Aug.', 'Sep.', 'Oct.', 'Nov.', 'Dec.'))) ?>;
var allDayText = '<?php echo $l->t('All day') ?>';
</script>
<div id="sysbox"></div>
<div id="controls">
......
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment