Jump to:

11002 Posts in 2734 Topics by 1823 members

All other Modules

SilverStripe Forums » All other Modules » Problem with Event Calender

Discuss all other Modules here.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1 2 3 4
Go to End
Author Topic: 4012 Views
  • Marco_D
    Avatar
    Community Member
    20 Posts

    Re: Problem with Event Calender Link to this post

    I tried the new version you mentioned.
    I can publish the new calender successfully to my site, but when clicking the link in the navigation label I get:

    FATAL ERROR: i18n::include_by_class: Class Calendar.ss.Calendar not found
    At line 1259 in C:\xampp\htdocs\sapphire\core\i18n.php

    user_error(i18n::include_by_class: Class Calendar.ss.Calendar not found,512)
    line 1259 of i18n.php

    i18n::include_by_class(Calendar.ss.Calendar)
    line 132 of Core.php

    _t(Calendar.ss.Calendar.BROWSECALENDAR,Browse the Calendar)
    line 14 of .cacheC..xampp.htdocs.event_calendar.templates.Layout.Calendar.ss

    include(C:\Users\Marco\AppData\Local\Temp\silverstripe-cacheC--xampp-htdocs\.cacheC..xampp.htdocs.event_calendar.templates.Layout.Calendar.ss)
    line 197 of SSViewer.php

    SSViewer->process(Calendar_Controller)
    line 189 of SSViewer.php

    SSViewer->process(Calendar_Controller)
    line 296 of Controller.php

    Controller->defaultAction(index,Array)
    line 267 of Controller.php

    Controller->run(Array)
    line 22 of ModelAsController.php

    ModelAsController->run(Array)
    line 104 of Director.php

    Director::direct(/belegungsplan/)
    line 158 of main.php
    Context
    Debug (Debug::showError() in line 180 of Debug.php)

    * class =

    Calendar.ss.Calendar

    * module =

    What is the reason for this error? Are you confident of solving this problem within a short period of time?

  • UncleCheese
    Avatar
    4085 Posts

    Re: Problem with Event Calender Link to this post

    When I'm not getting the error and no one else is reporting it, it's an extremely difficult thing to troubleshoot. The last update included changes to the template, so you probably want to do a ?flush=1 to make sure you're getting those updates.

    Make sure on Calendar.ss and CalendarEvent.ss that the _t() tags read something like

    _t('BROWSECALENDAR','Browse the calendar')

    instead of

    _t('Calendar.BROWSECALENDAR','Browse the calendar')

  • UncleCheese
    Avatar
    4085 Posts

    Re: Problem with Event Calender Link to this post

    Banal, do you have any thoughts on this? You seem pretty well versed in the translation functions. Did I do something wrong in the template?

  • banal
    Avatar
    Community Member
    901 Posts

    Re: Problem with Event Calender Link to this post

    Hello UncleCheese

    I had a look at your en_US.php language file. Here's what you should do:
    First of all, insert global $lang; at the top (you have to do this for every language file).
    The other thing to do is to insert all your translatable strings into the en_US.php file. Example:
    In Calendar.php you call _t('Calendar.NUMBERFUTUREDATES','Number of future dates to show for repeating events');
    You should put that as an entry in your language file, like this:

    $lang['en_US']['Calendar']['NUMBERFUTUREDATES'] = 'Number of future dates to show for repeating events';

    I know, this seems redundant at first because you already provide the English text in the Calendar.php. The text in the class is only meant as a fallback though and will not be used if a key with this name is available in the language file (entry in language file overrides the text you put in your class).
    Doing so will also expose all your translatable strings in one file and makes it very easy to translate (just take the en_US.php file and translate all the entries in there).

    When it comes to templates, there are two possibilites:
    You could use the exact same syntax as in your class:

    <% _t('Calendar.SUBSCRIBE','Subscribe to the Calendar') %>

    OR, you use the form you are using now:

    <% _t('SUBSCRIBE','Subscribe to the Calendar') %>

    But this requires you to have the following entry in your lang file:

    $lang['en_US']['Calendar.ss']['SUBSCRIBE'] = 'Subscribe to the Calendar';
    ------------------------^ important!

    How you organize this is up to you. Personally, I'd probably use the latter, since you can tell from the Lang file if the entry belongs to a template or to a Class.

    For further "inspiration", have a look at the lang files in the SilverStripe cms folder.

  • UncleCheese
    Avatar
    4085 Posts

    Re: Problem with Event Calender Link to this post

    Thanks, Banal. That's a great explanation. Sad to see that it creates a lot of work for me, though.

    Is there any way I can test this? It's strange that Marco_D is getting errors, but I don't. Should I try setting my locale to "de"? I'd like to make sure the problem is fixed before I publish the change.

  • banal
    Avatar
    Community Member
    901 Posts

    Re: Problem with Event Calender Link to this post

    Hi Uncle Cheese

    Yes, there's quite some work involved Maybe you could a script to extract your translatable strings. I'm not aware of such a tool for SilverStripe though.

    To test this, try to put the following in your sites _config.php:

    i18n::set_locale('de_DE');

    I'm currently not at the computer where I could test this.. so I can't confirm the errors Marco_D is getting.

  • banal
    Avatar
    Community Member
    901 Posts

    Re: Problem with Event Calender Link to this post

    Hi

    I just tested this and I'm not getting the errors Marco_D reported.
    The fallback of the translations works fine.. To make this whole thing translatable however, the steps mentioned previously are still imperative.

    Maybe Marco_D is trying to create a multilingual site, which won't work in SilverStripe 2.3.0 and 2.3.1 for now (should be fixed in 2.3.2).

    @UncleCheese: If you can complete the en_US.php file, I'll provide a German translation.

  • Marco_D
    Avatar
    Community Member
    20 Posts

    Re: Problem with Event Calender Link to this post

    Hey guys,

    thanks for your great help
    Currently I have some technical problems with my notebook. Therefore I am not able for instance to download and test new versions of the Event Calender module.
    I will give report at the end of the week.

    Regards
    Marco

    4012 Views
Page: 1 2 3 4
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.