I installed jscalendar and it works fine in english. However, when I switch to another locale (I tried both French and Italian) the calendar shows only the titlebar, the buttons and the status bar of the calendar (in the correct language), but the days of the week are replaced by "undefined" and the day numbers are not shown at all.

I noticed that in the locale file calendar-fr.js the accents were replaced with question marks (indicating a change in the file format somewhere). I tried removing them but that didn't change anything.

Comments

Alex Schenkman’s picture

Title: jscalendar not working with localization » Swedish
Version: master » 4.7.x-1.x-dev

Spanish shows questions marks instead of accents and swedish doesn't show at all.
Tested on firefox on OS X, hosted both locally and my hosting provider.

Any solution in sight?

Alex Schenkman’s picture

Title: Swedish » JsCalendar not working with internationalization

Sorry, i messed up the title of the issue.

Anonymous’s picture

I had the same problem with french language.

It's because the french language file (lib/lang/calendar-fr.js) was written in iso-8859-1 character encoding.
I did a copy from calendar-en.js, put everything in french with UTF-8 character encoding and everything works fine.

I did not find the calendar-se.js, so I can't help you more...

Moxide’s picture

Hi !

The problem seems to be a missing variable in the localization files (calendar-fr.js, for instance).
I just added the following:

Calendar._FD = 0;

And it worked.

patchak’s picture

Missing variable?? where should I add this exactly in the file? Should I replace something with that or just insert it?

Thanks for the help
patchak

Moxide’s picture

  1. Go in : "jscalendar\lib\lang"
  2. Edit the calendar file corresponding to your language.
  3. Put the Calendar._FD = 0; on a new line.

For instance:

...
Calendar._FD = 0;
// full day names
Calendar._DN = new Array
("Dimanche",
 "Lundi",
...
boz’s picture

StatusFileSize
new3.68 KB

Here the french language file in utf8

mphilipp’s picture

StatusFileSize
new3.89 KB

Same issues with German file in 5.x-0.3, corrected file attached.

nedjo’s picture

ray007 has kindly agreed to evaluate and apply patches to the language files.

ray007’s picture

Assigned: Unassigned » ray007

I have commited the french version file provided by boz to HEAD.
Would be nice if someone else could also verify that the included utf-8 cleanup is ok, so I can commit to the release-branches too.

For other languages: interested parties please provide patch files, or (if it's only about the weekday issue) indicate on which day weeks start in your country.

cybertron1’s picture

StatusFileSize
new3.71 KB

Here comes an UTF8 encoded versionen of the swedish language file (jstools for drupal 5 if it is different) of jscalendar.

floretan’s picture

These bugs for individual language files have also been submitted on JsCalendar's website at http://sourceforge.net/projects/jscalendar/ .

In the case of an update from the JsCalendar developers, it might be nice if we don't need to patch all the language files again, so after patching the files that we know to be wrong, it might be worth it to submit those patches directly to JsCalendar as well.

Thank you ray007 for making those patches.

ray007’s picture

There are lot's of bugreports there, but the project hasn't seen any activity for a whole year, and most files are unchanged for 2 years and longer.

So: if you find a language file or patch for your favorite language there, test it out, and if it all works post it somewhere over here. Since the authors of the upstream project have some contract for a commercial calendar project, they don't seem interested in doing much here anymore.
@nedjo: if you don't object, I'll insert a sentence into the project description for all to see, so maybe more people are motivated to post updated and checked language files here.

@cybertron1: I have also just committed the swedish language file to HEAD. I don't care a lot, but maybe you could also try to use \uXXXX notation inside the string instead of String.fromCharCode(), makes things imho look a bit nicer if it works.

ray007’s picture

Status: Active » Fixed

I have checked in some new js-files, swedish and french should be fine now.

If your other favorite language still doesn't work ... complain and/or send a new js-file.

Anonymous’s picture

Status: Fixed » Closed (fixed)
ricflomag’s picture

Version: 4.7.x-1.x-dev » 5.x-0.8
Status: Closed (fixed) » Active

Reopening the bug. Drupal 5.7, Jstools 0.8, spanish localization: Accents are displayed as question marks.

Its sounds very strange to me that the solution posted before was to change the value of "Calendar._FD", as this variable is used to specify which day of the week should be the first. It does not have anything to do with encoding... I don't understand.

The solution for me was to change the encoding of the jstools/jscalendar/lib/lang/calendar-es.js file from ISO-8859-15 to UTF8. The solution for everyone could be to use plain ASCII in the language files and replace all special characters by their codes, like "\xE1" for "á".

ricflomag’s picture

Version: 5.x-0.8 » 5.x-1.0

Still present in 1.0