cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nicolas Bielza <nicolas.bie...@gmail.com>
Subject Re: [CForms] Calendar i18n translation
Date Mon, 28 Nov 2005 18:56:45 GMT
Hello,

I did it (for cocoon 2.1.5).
I had to change forms-calendar-styling.xsl to call the i18n methods of
the calendar. Here's how it looks:

 <xsl:template match="head" mode="forms-calendar">
    <script src="{$resources-uri}/mattkruse-lib/CalendarPopup.js"
type="text/javascript"/>
    <script src="{$resources-uri}/mattkruse-lib/date.js"
type="text/javascript"/>
    <script type="text/javascript">
      // Setup calendar
      var forms_calendar = CalendarPopup('forms_calendarDiv');
      // forms_calendar.setWeekStartDay(1);
      // forms_calendar.showYearNavigation();
      // forms_calendar.showYearNavigationInput();
      forms_calendar.setCssPrefix("forms_");
			forms_calendar.setMonthNames('<i18n:text
catalogue="cal">january</i18n:text>','<i18n:text
catalogue="cal">february</i18n:text>','<i18n:text
catalogue="cal">march</i18n:text>','<i18n:text
catalogue="cal">april</i18n:text>','<i18n:text
catalogue="cal">may</i18n:text>','<i18n:text
catalogue="cal">june</i18n:text>','<i18n:text
catalogue="cal">july</i18n:text>','<i18n:text
catalogue="cal">august</i18n:text>','<i18n:text
catalogue="cal">september</i18n:text>','<i18n:text
catalogue="cal">october</i18n:text>','<i18n:text
catalogue="cal">november</i18n:text>','<i18n:text
catalogue="cal">december</i18n:text>');
			forms_calendar.setDayHeaders(<i18n:text
catalogue="cal">dayHeaders</i18n:text>);
			forms_calendar.setWeekStartDay(<i18n:text
catalogue="cal">weekStartDay</i18n:text>);
			forms_calendar.setTodayText("<i18n:text catalogue="cal">today</i18n:text>");
			forms_calendar.showNavigationDropdowns();
    </script>
    <link rel="stylesheet" type="text/css"
href="{$resources-uri}/forms-calendar.css"/>
  </xsl:template>

The english dictionary looks like this:

<?xml version="1.0" encoding="ISO-8859-1"?>
<catalogue xml:lang="en">
	<message key="january">january</message>
	<message key="february">february</message>
	<message key="march">march</message>
	<message key="april">april</message>
	<message key="may">may</message>
	<message key="june">june</message>
	<message key="july">july</message>
	<message key="august">august</message>
	<message key="september">september</message>
	<message key="october">october</message>
	<message key="november">november</message>
	<message key="december">december</message>
	<message key="today">today</message>
	<message key="dayHeaders">'S','M','T','W','T','F','S'</message>
	<message key="weekStartDay">0</message>
</catalogue>


2005/11/23, Josep A. Frau <peptoni@uib.es>:
> How can I translate the text in the popup calendar rended by
> forms-calendar-styling.xsl?
>
> I want to translate with the i18n transformer the text of "today",
> weekdays and month names.
>
> Someone have make this translations?
>
> --
> Josep A. Frau <peptoni@uib.es>
> Centre de Tecnologies de la InformaciĆ³
> Universitat de les Illes Balears
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message