French translate clock module (and scheduling calendar)

Hi

I added the french translate of the names of day of week in the file fr.mo, but the clock module continues to display in english (calendar scheduling also !)
Where is my error ?

Thanks

D.Vuillet

The clock module wasn’t translatable in 1.7.1 or before - we are releasing an update this week (we hope!) which will contain a translation mechanism for the clock.

The scheduling calendar should be translatable - but I think the file is named incorrectly - perhaps you could try to rename it and see if that works?

theme/default/libraries/calendar/js/language/fr_FR.js

rename to

theme/default/libraries/calendar/js/language/fr.js

Hi

Rename to fr.js is no effect with calendar…(ever in english)

Thanks

D.Vuillet

This is probably a silly question from me - but is the rest of the CMS in French? The menus, etc?

Yes, the rest of the CMS is in french and when I modify the file fr.mo, eg “display settings” was always in english, the modification is effective in the menu of the CMS but no effect with calendar and the names of the day of week.

Thanks

D.Vuillet

OK - we have just released 1.7.2, which should set the locale for the clock module. I will need to investigate the translation of the calendar in more detail.

Is it Sunday…Saturday that I have to translate (not Sun…Sat) in mo file ?

Thanks

D.Vuillet

The Scheduling Calendar doesn’t use the translations from the MO file because it is a JavaScript library (confusing I know). The library has already been translated, but for some reason the translation has not become active when you selected that locale.

It will need a bit more investigation - i’ve created an issue for 1.7.3

I updated to 1.7.2 and the names of day of week in the clock module are ever in english. Is clock module uses (or not) the mo file ?

Thanks

D.Vuillet

No - dates and times in general do not use the MO file. The MO file is for translating strings that originate from Xibo, rather than translating strings that are generic (like dates and times).

You should find a new option in the region section of the CMS settings called “Show international dates?”. Can you make sure that is set to ON ?

I checked the box called “Show international dates” but the names of the day of week are ever in english

Thanks

D.Vuillet

That probably means your PHP installation doesn’t support international date formatting, or maybe doesn’t have the FR locale installed.

Installation Instructions for reference.

We probably need to add a check for that when that setting is enabled so that it is obvious what will work and wont work.

On the linux server, locale command says:
LANG=fr_FR.UTF-8
LC_CTYPE="fr_FR.UTF-8"
LC_NUMERIC="fr_FR.UTF-8"
LC_TIME="fr_FR.UTF-8"
LC_COLLATE="fr_FR.UTF-8"
LC_MONETARY="fr_FR.UTF-8"
LC_MESSAGES="fr_FR.UTF-8"
LC_PAPER="fr_FR.UTF-8"
LC_NAME="fr_FR.UTF-8"
LC_ADDRESS="fr_FR.UTF-8"
LC_TELEPHONE="fr_FR.UTF-8"
LC_MEASUREMENT="fr_FR.UTF-8"
LC_IDENTIFICATION="fr_FR.UTF-8"
LC_ALL=

php5-intl is installed and configured

But clock module always displays that we are “tuesday” instead of “mardi” (tuesday in french !)

Thanks
D.Vuillet

In clock module configuration I have:
clock type : digital
format for the clock : dddd DD MMMM YYYY HH:mm

and clock module displays : tuesday 17 march 2015 17:30

Thanks
DV

Can you add some logging to a file in the CMS?

lib/app/datemanager.class.php add a new line above Line 55:

Debug::Error('Intl Available: ' . Config::GetSetting('DEFAULT_LANGUAGE') . '. Format = ' . $format);

And then before Line 59

Debug::Error('Intl Not available');

I added both lines.
What to do next? Where can I read logged lines?

Thanks

They should be logged in the Advanced -> Log page whenever a date is parsed. So open the layout designer and your clock should load, causing the error to log.

I got these lines :


I checked the log page before loading the layout and truncated it to be sure it was empty. Then I loaded the layout only once.

I wondered why there were so many lines. Actually the layout I was loading has two tickers modules. It seems that these modules try to parse dates as well.

So I created a new layout for the purpose of testing only the clock module. Same configuration as the first one. Of course, the date is still not translated but when I load or preview it, no further log is created.

So it seems the whole logged lines above were created by the ticker modules only.

Ah, that was silly of me - i’m sorry i’ve lead you on a wild goose chase. The clock is also rendered in JavaScript and will therefore need some additional work to get it internationalised.

I’ve created a new issue for it: