At the moment the calendar is untranslatable.
After playing with the google calendar I think I might have find a clean solution.
To translate my calendar I had to add following code (dutch)
buttonText: {
today: 'vandaag',
day: 'dag',
week:'week',
month:'maand'
},
monthNames:['januari','februari','maart','april','mei','juni','juli','augustus','september','okotber','november','december'],
monthNamesShort: ['jan','feb','maa','apr','mei','jun','jul','aug','sep','okt','nov','dec'],
dayNames: ['zondag','maandag','dinsdag','woensdag','donderdag','vrijdag','zaterdag'],
dayNamesShort: ['zon','ma','di','woe','don','vrij','zat'],
I don't know a lot about t('') functions, but could we generate these strings in the module with a t(' ') function and pass that string to javascript setting.
Something like this
function template_preprocess_views_view_fullcalendar(&$vars) {
...
$settings = array(
....
'monthsString'=> getMonthsString(),
);
...
}
function getMonthsString() {
return t('January) . ',' . t('February) . ',' t('March) . ',' t('April) . ',' ....
}
monthNames:[Drupal.settings.fullcalendar.monthsString],
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | fullcalendar_translatable_d6.patch | 1.79 KB | aspilicious |
| #6 | fullcalendar_translated_final_again.patch | 1.75 KB | aspilicious |
| #5 | fullcalendar_translated_final.patch | 1.79 KB | aspilicious |
| #3 | fullcalendar_translated-without_gcal_stuff.patch | 2.68 KB | aspilicious |
| #1 | fullcalendar_translated.patch | 2.9 KB | aspilicious |
Comments
Comment #1
aspilicious commentedI'm so smart... lol XD
This actually works :p
Patch attached, I think we can reuse some functions from other modules to get the array of translated months and days.
But besides of that I like my work.
Comment #2
aspilicious commentedComment #3
aspilicious commentedWhoops, some left overs from the gcal things I was doing...
EDIT:
screenshot: http://awesomescreenshot.com/01967jfe9
Comment #4
aspilicious commentedAnd while we are on it, we should add one more:
Comment #5
aspilicious commentedFinal patch?
Comment #6
aspilicious commentedOk lets try again :( hate windows endings
Comment #7
tim.plunkettAwesome! Thanks for this. About to commit, but do you feel like rolling it for D6 too? :)
Comment #8
tim.plunketthttp://drupal.org/cvs?commit=485798
I'm okay with putting this in 6.x-1.x.
Comment #9
aspilicious commentedfor both branches
Comment #10
tim.plunketthttp://drupal.org/cvs?commit=485818
and
http://drupal.org/cvs?commit=485820
Comment #11
yoran scholiers commentedThank you for this patch, only one small error I think. (altough I'm not sure if it is in the patch or somewhere else)
After installing the patch, 'Sunday' was translated as ''!day-abbrevation Zon. The problem was that the translation said '!day-abbrevation instead of '!day-abbrevIation'
I don't know if it has anything to do with the patch, or if I made a mistake on my end.
either way, Thank you!
Comment #12
tim.plunkettI don't know very much about how localization works, but I know that we're just calling Date module's functions.
Looking at http://api.lullabot.com/date_t_strings, it is "!day-abbreviation".
That being said, the 6.x-2.x and 7.x-2.x branches are getting string overhauls, because the current strings are outrageously complicated to translate. See #1036444: Cleanup the views UI + remove autodiscovery mega issue. for progress on that.
Comment #13
aspilicious commentedI think its
---------
1) A manual mistake on your side
2) A bad translated date string (from date module)
Not our fault :)
Comment #14
yoran scholiers commentedIts indeed a bad translated string from the date module ;)
Thanks again, this small update made the module (for me) 100x better!
Comment #15
aspilicious commentedBelgians help each other ;)