Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

All other Modules /

Discuss all other Modules here.

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

Event Calendar: New Feature


Go to End


16 Posts   5473 Views

Avatar
UncleCheese

Forum Moderator, 4102 Posts

1 October 2009 at 2:30am

I don't even see a pl_PL file in the EventCalendar module. Did you create one?

Avatar
karibe

Community Member, 56 Posts

1 October 2009 at 7:36pm

Yes I did. Now in lang dir are en_US.php de_DE.php and pl_PL.php . I did translations basing on en_US.php
and it works on almost whole calendar interface beside $LiveCalendarWidget and $CalendarFilterForm.
So I'm trying to solve it.

Avatar
UncleCheese

Forum Moderator, 4102 Posts

2 October 2009 at 1:46am

Found the problem. First, update your SVN to get a new LiveCalendarWidget.ss

Then, make sure your entry in your lang file is:

$lang['pl_PL']['LiveCalendarWidget.ss']['JUMPTOMONTH'] = 'Some Polish words';

and not:

$lang['pl_PL']['LiveCalendarWidget']['JUMPTOMONTH'] = 'Some Polish words';

Avatar
karibe

Community Member, 56 Posts

2 October 2009 at 2:56am

Ok, works great, thanks for help and fast reaction.
I hope last problem, fragments of code LiveCalendarWidget.ss:
lines 14-16

          <% control NavigationOptions %>
            <option value="$Link" $Selected>$Month</option>
          <% end_control %>

and 28-34

			<td class="calendarDayName">$Sun</td>
			<td class="calendarDayName">$Mon</td>
			<td class="calendarDayName">$Tue</td>
			<td class="calendarDayName">$Wed</td>
			<td class="calendarDayName">$Thu</td>
			<td class="calendarDayName">$Fri</td>
			<td class="calendarDayName">$Sat</td>

names of months and days are still in English which is fine when page is displayed in English. But this is multi language page with second English language and first Polish language. How to do translations for months/days names?

How to change calendar to be displayed from Mondays not from Sundays or make it dependable from locales?

Avatar
UncleCheese

Forum Moderator, 4102 Posts

2 October 2009 at 3:07am

The day names are translated like this:

return strftime('%a',$timestamp);

So make sure your PHP locale is set correctly.

Avatar
karibe

Community Member, 56 Posts

2 October 2009 at 10:13pm

Yeah!
Works after setting it up like this:

		if($this->dataRecord->hasExtension('Translatable')) 
		{
			if ( ereg("^".Translatable::default_lang(), $_SERVER['HTTP_ACCEPT_LANGUAGE']) )
			{
				i18n::set_locale(Translatable::default_locale());
				setlocale(LC_ALL, Translatable::default_locale().'.utf8');
			}
			else
			{
				Translatable::set_current_locale("en_US");
				i18n::set_locale("en_US");
				setlocale(LC_ALL, "en_US.utf8");
			}
		}

How to translate 'Start' and 'End' words in $CalendarFilterForm?

Avatar
UncleCheese

Forum Moderator, 4102 Posts

3 October 2009 at 1:36am

You can use CalendarFilterFieldSet.START and CalendarFilterFieldSet.END. Glad it's working!

Avatar
karibe

Community Member, 56 Posts

3 October 2009 at 1:50am

Mission accomplished:) Thanks UncleCheese for Your great help!

Go to Top