Internationalization

From semantic-mediawiki.org

Thanks for a beautiful calendar. How do we get this extension into other languages, are there locales, or is it possible to translate? Any advice would be appreciated.

18:29, 28 September 2012

Thanks and well I'd love to see other people getting involved.

As for the internationalization this is rather a fullcalendar.js issues than a SRF printer issue because the resource definition can get access to translations that are transferred from MW (see [1]). Maybe [2],[3] can shed some light on what needs to be done in order to get a more internationalized calendar version.

Something like below should be feasible (I haven't checked nor tested it)

buttonText: {
            today: mw.msg( 'srf-eventcalendar-button-today' ),
        },

Hope this helps ...

[1] https://www.mediawiki.org/wiki/Localisation#Using_messages_in_JavaScript

[2] http://code.google.com/p/fullcalendar/issues/detail?id=47

[3] http://stackoverflow.com/questions/8106646/jquery-fullcalendar-full-translation

23:08, 28 September 2012

We need to create and maintain message-identifiers in fullcalendar.js. We need to create an i18n.php-file containting those messages. We need to make them work together using the ResourceLoader.

I know php and js but not how to practically contribute code and i18n-text to the project. You can contact me by e-mail if you want.

Martin

16:05, 4 October 2012

You don't have to create an extra file, you only have to register all message keys with SRF_Messages.php and publish those keys with SRF_Resources.php as well (see example 'messages' => array( ...)) to ensure the resource file is able to access those messages. (If you register message keys with SRF_Resources.php than the ResourceLoader integration will taken care of.)

The only thing that is left is to adjust the ext.srf.eventcalendar.js file with those message keys (using mw.msg( 'srf-eventcalendar-label-...' )) so the fullcalendar object can access those translated messages. (see links above for proposed methods on how this can be achieved in a fullcalendar instance ).

If you need advise on how to add translations to SMW/SRF messages files (SRF_Messages.php), you can contact Kghbln on this matter.

Please be remind that all what is provided here is community work and since my timetable will not allow me to drill into this further, I hope the above description is enough to give you a heads up otherwise you might consult [1], [2] as well.

[1] http://www.mediawiki.org/wiki/ResourceLoader/Features

[2] https://www.mediawiki.org/wiki/Localisation#Using_messages_in_JavaScript

16:43, 4 October 2012

Well, since I figured that might take a bit for you to get it work. I added i18n support with [1]. Which means as soon as the keys are available in translatewiki, you can start to translate

	'srf-ui-eventcalendar-label-today' => 'Today',
	'srf-ui-eventcalendar-label-month' => 'Month',
	'srf-ui-eventcalendar-label-week' => 'Week',
	'srf-ui-eventcalendar-label-day' => 'Day',
	'srf-ui-eventcalendar-label-allday' => 'All day',
	'srf-ui-eventcalendar-format-time' => 'h(:mm)t',
	'srf-ui-eventcalendar-format-time-agenda' => 'H:mm( - H:mm)',
	'srf-ui-eventcalendar-format-axis' => 'H:mm',
	'srf-ui-eventcalendar-format-title-month' => 'MMMM yyyy',
	'srf-ui-eventcalendar-format-title-week' => 'd [ yyyy]{ \'—\'[ MMM] d MMM yyyy}',
	'srf-ui-eventcalendar-format-title-day' => 'dddd, d MMM, yyyy',
	'srf-ui-eventcalendar-format-column-month' => 'ddd',
	'srf-ui-eventcalendar-format-column-week' => 'ddd d/M',
	'srf-ui-eventcalendar-format-column-day' => 'dddd d/M',

Month, days are taken from MW's own message key's, so no need for any translation.

[1] https://gerrit.wikimedia.org/r/#/c/26735/

16:28, 5 October 2012

Perfect!

Thought it would be good to have the other texts translated as well so just did 100% of SMW and SRF (except for om SMW-message that does not show it's pop-up window).

20:24, 5 October 2012