]> git.mxchange.org Git - friendica.git/commitdiff
Internationalisation of events/Move events to the navigation bar
authorMichael Vogel <icarus@dabo.de>
Sun, 27 Sep 2015 12:00:15 +0000 (14:00 +0200)
committerMichael Vogel <icarus@dabo.de>
Sun, 27 Sep 2015 12:00:15 +0000 (14:00 +0200)
include/nav.php
mod/events.php
view/templates/event_head.tpl
view/theme/vier/templates/nav.tpl

index e7f51cc0c055b08c56ded311e5a27a7a7a4766a9..f3dec64bffb0c87edbbccacf96e09cb7a6ea68ef 100644 (file)
@@ -138,6 +138,8 @@ function nav_info(&$a) {
        elseif(get_config('system','community_page_style') == CP_GLOBAL_COMMUNITY)
                $nav['community'] = array('community', t('Community'), "", t('Conversations on the network'));
 
+       $nav['events'] = Array('events', t('Events'), "", t('Events and Calendar'));
+
        $nav['directory'] = array($gdirpath, t('Directory'), "", t('People directory'));
 
        $nav['about'] = Array('friendica', t('Information'), "", t('Information about this friendica instance'));
index 242f27f135b59b3cf987bfe402037a053b361372..ff615141705ceb0c3af8f04747396a7af4f4fae0 100644 (file)
@@ -184,9 +184,60 @@ function events_content(&$a) {
        if( feature_enabled(local_user(), 'richtext') )
                $editselect = 'textareas';
 
+       // First day of the week (0 = Sunday)
+       // To-Do: Needs to be configurable
+       $firstDay = 0;
+
+       $i18n = array(
+                       "firstDay" => $firstDay,
+                       "Sun" => t("Sun"),
+                       "Mon" => t("Mon"),
+                       "Tue" => t("Tue"),
+                       "Wed" => t("Wed"),
+                       "Thu" => t("Thu"),
+                       "Fri" => t("Fri"),
+                       "Sat" => t("Sat"),
+                       "Sunday" => t("Sunday"),
+                       "Monday" => t("Monday"),
+                       "Tuesday" => t("Tuesday"),
+                       "Wednesday" => t("Wednesday"),
+                       "Thursday" => t("Thursday"),
+                       "Friday" => t("Friday"),
+                       "Saturday" => t("Saturday"),
+                       "Jan" => t("Jan"),
+                       "Feb" => t("Feb"),
+                       "Mar" => t("Mar"),
+                       "Apr" => t("Apr"),
+                       "May" => t("May"),
+                       "Jun" => t("Jun"),
+                       "Jul" => t("Jul"),
+                       "Aug" => t("Aug"),
+                       "Sep" => t("Sept"),
+                       "Oct" => t("Oct"),
+                       "Nov" => t("Nov"),
+                       "Dec" => t("Dec"),
+                       "January" => t("January"),
+                       "February" => t("February"),
+                       "March" => t("March"),
+                       "April" => t("April"),
+                       "May" => t("May"),
+                       "June" => t("June"),
+                       "July" => t("July"),
+                       "August" => t("August"),
+                       "September" => t("September"),
+                       "October" => t("October"),
+                       "November" => t("November"),
+                       "December" => t("December"),
+                       "today" => t("today"),
+                       "month" => t("month"),
+                       "week" => t("week"),
+                       "day" => t("day"),
+               );
+
        $htpl = get_markup_template('event_head.tpl');
        $a->page['htmlhead'] .= replace_macros($htpl,array(
                '$baseurl' => $a->get_baseurl(),
+               '$i18n' => $i18n,
                '$editselect' => $editselect
        ));
 
index a96e5aff31c1f54a51bc8f2ef231e223e3bda77d..ceb251a9e21243fb992dcfc1f15604032efbabcc 100644 (file)
@@ -1,7 +1,7 @@
 
 <link rel='stylesheet' type='text/css' href='{{$baseurl}}/library/fullcalendar/fullcalendar.css' />
 <script language="javascript" type="text/javascript"
-          src="{{$baseurl}}/library/fullcalendar/fullcalendar.min.js"></script>
+         src="{{$baseurl}}/library/fullcalendar/fullcalendar.min.js"></script>
 
 <script>
        function showEvent(eventid) {
                        }
                );                      
        }
-        
-        function doEventPreview() {
-                $('#event-edit-preview').val(1);
-                $.post('events',$('#event-edit-form').serialize(), function(data) {
-                        $.colorbox({ html: data });
-                });
-                $('#event-edit-preview').val(0);
+
+       function doEventPreview() {
+               $('#event-edit-preview').val(1);
+               $.post('events',$('#event-edit-form').serialize(), function(data) {
+                       $.colorbox({ html: data });
+               });
+               $('#event-edit-preview').val(0);
        }
 
-       
+
        $(document).ready(function() {
                $('#events-calendar').fullCalendar({
+                       firstDay: {{$i18n.firstDay}},
+                       monthNames: ['{{$i18n.January}}','{{$i18n.February}}','{{$i18n.March}}','{{$i18n.April}}','{{$i18n.May}}','{{$i18n.June}}','{{$i18n.July}}','{{$i18n.August}}','{{$i18n.September}}','{{$i18n.October}}','{{$i18n.November}}','{{$i18n.December}}'],
+                       monthNamesShort: ['{{$i18n.Jan}}','{{$i18n.Feb}}','{{$i18n.Mar}}','{{$i18n.Apr}}','{{$i18n.May}}','{{$i18n.Jun}}','{{$i18n.Jul}}','{{$i18n.Aug}}','{{$i18n.Sep}}','{{$i18n.Oct}}','{{$i18n.Nov}}','{{$i18n.Dec}}'],
+                       dayNames: ['{{$i18n.Sunday}}','{{$i18n.Monday}}','{{$i18n.Tuesday}}','{{$i18n.Wednesday}}','{{$i18n.Thursday}}','{{$i18n.Friday}}','{{$i18n.Saturday}}'],
+                       dayNamesShort: ['{{$i18n.Sun}}','{{$i18n.Mon}}','{{$i18n.Tue}}','{{$i18n.Wed}}','{{$i18n.Thu}}','{{$i18n.Fri}}','{{$i18n.Sat}}'],
+                       buttonText: {
+                               prev: "<span class='fc-text-arrow'>&lsaquo;</span>",
+                               next: "<span class='fc-text-arrow'>&rsaquo;</span>",
+                               prevYear: "<span class='fc-text-arrow'>&laquo;</span>",
+                               nextYear: "<span class='fc-text-arrow'>&raquo;</span>",
+                               today: '{{$i18n.today}}',
+                               month: '{{$i18n.month}}',
+                               week: '{{$i18n.week}}',
+                               day: '{{$i18n.day}}'
+                       },
                        events: '{{$baseurl}}/events/json/',
                        header: {
                                left: 'prev,next today',
@@ -34,7 +49,7 @@
                        eventClick: function(calEvent, jsEvent, view) {
                                showEvent(calEvent.id);
                        },
-                        loading: function(isLoading, view) {
+                       loading: function(isLoading, view) {
                                if(!isLoading) {
                                        $('td.fc-day').dblclick(function() { window.location.href='/events/new?start='+$(this).data('date'); });
                                }
 
 {{if $editselect != 'none'}}
 <script language="javascript" type="text/javascript"
-          src="{{$baseurl}}/library/tinymce/jscripts/tiny_mce/tiny_mce_src.js"></script>
+         src="{{$baseurl}}/library/tinymce/jscripts/tiny_mce/tiny_mce_src.js"></script>
 <script language="javascript" type="text/javascript">
 
 
                }
 
        });
-        {{else}}
+       {{else}}
        <script language="javascript" type="text/javascript">
        {{/if}}
 
index 11add9e8a81d05cc87cfd00794c8e1464f8ad5d7..4888468cee43b5d269cc94123feb74d7d78a0224 100644 (file)
                                <span id="net-update" class="nav-notify"></span>
                        </li>
                {{/if}}
+               {{if $nav.events}}
+                       <li role="menuitem" id="nav-events-link" class="nav-menu {{$sel.events}}">
+                               <a accesskey="e" class="{{$nav.events.2}}" href="{{$nav.events.0}}" title="{{$nav.events.3}}" >{{$nav.events.1}}</a>
+                       </li>
+               {{/if}}
                {{if $nav.community}}
                        <li role="menuitem" id="nav-community-link" class="nav-menu {{$sel.community}}">
                                <a accesskey="c" class="{{$nav.community.2}}" href="{{$nav.community.0}}" title="{{$nav.community.3}}" >{{$nav.community.1}}</a>