You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by mmainar <ma...@gmail.com> on 2010/11/12 19:07:57 UTC

Tapx-Datefield

Hi everyone,

I am trying to learn Tapestry and I have a problem I haven't been able to
solve so far. I am using Tapx-Datefield in my pages. However, I would like
to change the language of the calendar. I have read the documentation of the
Dynarch DHTML Calendar but I cannot figure out how to apply the language
setting instructions there in a Tapestry page. I can see that in the
tapx-datefield JAR file there is a lang folder containing different
JavaScript files for a range of languages, but I don't know how can I load
one of them from my pages. I am currently using Tapestry 5.1.0.5 and
Tapx-Datefield 1.0.0.

I would be very grateful if anyone can help me.

Marcos
-- 
View this message in context: http://tapestry.1045711.n5.nabble.com/Tapx-Datefield-tp3262511p3262511.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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


Re: Tapx-Datefield

Posted by mmainar <ma...@gmail.com>.
Hi François,

thanks a lot for your help, I declared the locale and everything is fine
now.
-- 
View this message in context: http://tapestry.1045711.n5.nabble.com/Tapx-Datefield-tp3262511p3265483.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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


Re: Tapx-Datefield

Posted by françois facon <fr...@gmail.com>.
Hi Markos,

If you have a look a the code of DateField component

https://github.com/hlship/tapx/blob/release-1.0.0/tapx-datefield/src/main/java/com/howardlewisship/tapx/datefield/components/DateField.java

in beginRender you will find

 String language = locale.getLanguage();
 String supported = SUPPORTED_LANGUAGES.contains(language) ? language :
"en";
String language = locale.getLanguage();

            String supported = SUPPORTED_LANGUAGES.contains(language) ?
language : "en";

            // Can't use annotations when so much is calculated dynamically.


            renderSupport.addClasspathScriptLink(calendarPath +
"/calendar.js",
                                                 calendarPath +
"/calendar-setup.js",
                                                 calendarPath +
"/lang/calendar-" + supported + ".js");


            renderSupport.addScriptLink(datefieldLibrary);



it mean's that the component will add the right js according to your locale
if your locale is supported.

did you declare your supported locale on your appModule?

 like the following code

 public static void
contributeApplicationDefaults(MappedConfiguration<String, String>
configuration)
    {
        ...
        configuration.add(SymbolConstants.SUPPORTED_LOCALES, "en,fr,de");
    }

François

2010/11/12 mmainar <ma...@gmail.com>

>
> Hi everyone,
>
> I am trying to learn Tapestry and I have a problem I haven't been able to
> solve so far. I am using Tapx-Datefield in my pages. However, I would like
> to change the language of the calendar. I have read the documentation of
> the
> Dynarch DHTML Calendar but I cannot figure out how to apply the language
> setting instructions there in a Tapestry page. I can see that in the
> tapx-datefield JAR file there is a lang folder containing different
> JavaScript files for a range of languages, but I don't know how can I load
> one of them from my pages. I am currently using Tapestry 5.1.0.5 and
> Tapx-Datefield 1.0.0.
>
> I would be very grateful if anyone can help me.
>
> Marcos
> --
> View this message in context:
> http://tapestry.1045711.n5.nabble.com/Tapx-Datefield-tp3262511p3262511.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>