3

This is so driving me insane. I installed this: http://drupal.org/project/calendar

Now I'm trying to get the 'Next' and 'Prev' links in the monthly calendar to translate. Those strings don't show up in string translation, so I decided to look for their origins; where do they come from. Problem is, I can't even find the markup. The rendered final markup looks like

<ul class="pager">
    <li class="date-prev">
        <a href="http://pirkanmaa.fi/fi/etusivu/tapahtumakalenteri?mini=2013-02" title="Navigate to previous month" rel="nofollow">« Prev</a>      &nbsp;
    </li>
    <li class="date-next">&nbsp;
        <a href="http://pirkanmaa.fi/fi/etusivu/tapahtumakalenteri?mini=2013-04" title="Navigate to next month" rel="nofollow">Next »</a>
    </li>
</ul>

It has to be somewhere, but where?

2 Answers 2

5

The pager markup is not directly related to calendar. It is part of date views, a submodule to the date module. Assuming your date module is installed in sites/all/modules, you can override the markup by copying the templates in sites/all/modules/date/date_views/themes to your themes template directory. You can also see the template preprocess functions in sites/all/modules/date/date_views/themes/theme.inc

1
  • 1
    This should be accepted as correct; helped me. Thanks :)
    – Renee
    Aug 17, 2013 at 6:59
2

The calendar module is a view so all the templates related to view is applicable here too. When you check the calendar view there is a theme information in the advanced section when you click on that you would get the list of all the themes used

enter image description here

The pagers are printed in the Display output the first one in the list. When you click on the you will get the code for displaying the view. Copy that and create a new file with the names suggested in the list. If you want this to be for all the views then you can select views-view.tpl.php the last one will be specific to the current view so it will effect only the current view.

Once you have copied the code there are two variables that out put the pager $header and $pager The $header is used if your pager is a the top of the calendar and $pager is used if it is at the bottom. Depending on your settings you can do a string replace on that variable some thing like

$header = str_replace("prev", "new prev", $header);

If you are using i18n module for translation then you should also look at Internationalization Views

Note: Drupal 7 version is still in development phase.

1
  • This is true generally, but it isn't true for date pagers, which the questioner was asking about. They aren't output in the $pagers variable of the views template. They're attached in a different way (see answer below.)
    – Renee
    Aug 17, 2013 at 6:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.