You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Mohammad Shamsi <m....@gmail.com> on 2007/10/15 15:36:42 UTC

can i change locale manually or not ???

i was read in tapestry localization guide that : Tapestry does not yet
support changing the locale, but that will be available shortly.

but in wiki T5 Howto, i read a guide to changing locale  in tapestry, look
at code :

@Inject
private PersistentLocale persistentLocale;

public void onActionFromChangeLocale(String language)
{
        persistentLocale.set(new Locale(language));
}


but change locale here, don't effect on my pages :( , any idea ?

-- 
sincerely yours
M. H. Shamsi

Re: can i change locale manually or not ???

Posted by Nick Westgate <ni...@key-planning.co.jp>.
If you created your project using the maven archetype, you have one:
http://tapestry.apache.org/tapestry5/tutorial1/first.html

The documentation for modules is under tapestry-ioc:
http://tapestry.apache.org/tapestry5/tapestry-ioc/module.html

Cheers,
Nick.


Mohammad Shamsi wrote:
> No, I don't have AppModule class,
> where can i find docs or guide for Application Module Class in T5 ????
> 
> 
> 
> On 10/16/07, Nick Westgate <ni...@key-planning.co.jp> wrote:
>> Have you changed the line in your AppModule.java to the following?
>>      configuration.add("tapestry.supported-locales", "en,de");
>>
>> Cheers,
>> Nick.
>>
>>
>> Mohammad Shamsi wrote:
>>> Hi Nick,
>>>
>>> I have just a Start Page, and 2 Property Files (Start.properties,
>>> Start_de.properties)
>>>
>>> i have an actionlinke in page to change Locale,
>>>
>>> here is my code in Start.java class to change locale :
>>>
>>> @Inject
>>> private PersistentLocale persistentLocale;
>>>
>>>  public void onActionFromChangeLocale(String language)
>>>
>>>>  {
>>>>          persistentLocale.set(new Locale(language));
>>>>  }
>>>
>>> when i debug this code, persistenceLocale changed to German, but i see
>>> English Locale (Default Locale) again
>>>
>>> On 10/16/07, Nick Westgate <ni...@key-planning.co.jp> wrote:
>>>> The docs are out of date, hence the wiki.
>>>>
>>>> "Don't effect" is not specific enough. Give us the info to help you.
>>>> What are you trying do? What are the names of your localized files?
>>>> How is this event being invoked from your .tml file?
>>>>
>>>> Cheers,
>>>> Nick.
>>>>
>>>>
>>>> Mohammad Shamsi wrote:
>>>>> i was read in tapestry localization guide that : Tapestry does not yet
>>>>> support changing the locale, but that will be available shortly.
>>>>>
>>>>> but in wiki T5 Howto, i read a guide to changing locale  in tapestry,
>>>> look
>>>>> at code :
>>>>>
>>>>> @Inject
>>>>> private PersistentLocale persistentLocale;
>>>>>
>>>>> public void onActionFromChangeLocale(String language)
>>>>> {
>>>>>         persistentLocale.set(new Locale(language));
>>>>> }
>>>>>
>>>>>
>>>>> but change locale here, don't effect on my pages :( , any idea ?
>>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>
>>>>
>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
> 
> 

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


Re: can i change locale manually or not ???

Posted by Robin Helgelin <lo...@gmail.com>.
On 10/16/07, Mohammad Shamsi <m....@gmail.com> wrote:
> No, I don't have AppModule class,
> where can i find docs or guide for Application Module Class in T5 ????

If you generated your projected with maven quickstart you should have
an xxx.yyy.services.AppModule class.

-- 
        regards,
        Robin

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


Re: can i change locale manually or not ???

Posted by Mohammad Shamsi <m....@gmail.com>.
No, I don't have AppModule class,
where can i find docs or guide for Application Module Class in T5 ????



On 10/16/07, Nick Westgate <ni...@key-planning.co.jp> wrote:
>
> Have you changed the line in your AppModule.java to the following?
>      configuration.add("tapestry.supported-locales", "en,de");
>
> Cheers,
> Nick.
>
>
> Mohammad Shamsi wrote:
> > Hi Nick,
> >
> > I have just a Start Page, and 2 Property Files (Start.properties,
> > Start_de.properties)
> >
> > i have an actionlinke in page to change Locale,
> >
> > here is my code in Start.java class to change locale :
> >
> > @Inject
> > private PersistentLocale persistentLocale;
> >
> >  public void onActionFromChangeLocale(String language)
> >
> >>  {
> >>          persistentLocale.set(new Locale(language));
> >>  }
> >
> >
> > when i debug this code, persistenceLocale changed to German, but i see
> > English Locale (Default Locale) again
> >
> > On 10/16/07, Nick Westgate <ni...@key-planning.co.jp> wrote:
> >> The docs are out of date, hence the wiki.
> >>
> >> "Don't effect" is not specific enough. Give us the info to help you.
> >> What are you trying do? What are the names of your localized files?
> >> How is this event being invoked from your .tml file?
> >>
> >> Cheers,
> >> Nick.
> >>
> >>
> >> Mohammad Shamsi wrote:
> >>> i was read in tapestry localization guide that : Tapestry does not yet
> >>> support changing the locale, but that will be available shortly.
> >>>
> >>> but in wiki T5 Howto, i read a guide to changing locale  in tapestry,
> >> look
> >>> at code :
> >>>
> >>> @Inject
> >>> private PersistentLocale persistentLocale;
> >>>
> >>> public void onActionFromChangeLocale(String language)
> >>> {
> >>>         persistentLocale.set(new Locale(language));
> >>> }
> >>>
> >>>
> >>> but change locale here, don't effect on my pages :( , any idea ?
> >>>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> >> For additional commands, e-mail: users-help@tapestry.apache.org
> >>
> >>
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
sincerely yours
M. H. Shamsi

Re: can i change locale manually or not ???

Posted by Nick Westgate <ni...@key-planning.co.jp>.
Have you changed the line in your AppModule.java to the following?
     configuration.add("tapestry.supported-locales", "en,de");

Cheers,
Nick.


Mohammad Shamsi wrote:
> Hi Nick,
> 
> I have just a Start Page, and 2 Property Files (Start.properties,
> Start_de.properties)
> 
> i have an actionlinke in page to change Locale,
> 
> here is my code in Start.java class to change locale :
> 
> @Inject
> private PersistentLocale persistentLocale;
> 
>  public void onActionFromChangeLocale(String language)
> 
>>  {
>>          persistentLocale.set(new Locale(language));
>>  }
> 
> 
> when i debug this code, persistenceLocale changed to German, but i see
> English Locale (Default Locale) again
> 
> On 10/16/07, Nick Westgate <ni...@key-planning.co.jp> wrote:
>> The docs are out of date, hence the wiki.
>>
>> "Don't effect" is not specific enough. Give us the info to help you.
>> What are you trying do? What are the names of your localized files?
>> How is this event being invoked from your .tml file?
>>
>> Cheers,
>> Nick.
>>
>>
>> Mohammad Shamsi wrote:
>>> i was read in tapestry localization guide that : Tapestry does not yet
>>> support changing the locale, but that will be available shortly.
>>>
>>> but in wiki T5 Howto, i read a guide to changing locale  in tapestry,
>> look
>>> at code :
>>>
>>> @Inject
>>> private PersistentLocale persistentLocale;
>>>
>>> public void onActionFromChangeLocale(String language)
>>> {
>>>         persistentLocale.set(new Locale(language));
>>> }
>>>
>>>
>>> but change locale here, don't effect on my pages :( , any idea ?
>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
> 
> 

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


Re: can i change locale manually or not ???

Posted by syka <ay...@yahoo.com>.
I have same problem and I have AppModule.class under xxx.yyy.services

 public static void contributeApplicationDefaults(
            MappedConfiguration<String, String> configuration) {
        configuration.add("tapestry.supported-locales", "en,de"); 
    }

this is added in my class.When I put breakpoint here it doesnt stop there
why? and locale still set "en"



dalahoo wrote:
> 
> Hi Nick,
> 
> I have just a Start Page, and 2 Property Files (Start.properties,
> Start_de.properties)
> 
> i have an actionlinke in page to change Locale,
> 
> here is my code in Start.java class to change locale :
> 
> @Inject
> private PersistentLocale persistentLocale;
> 
>  public void onActionFromChangeLocale(String language)
> 
>>  {
>>          persistentLocale.set(new Locale(language));
>>  }
> 
> 
> when i debug this code, persistenceLocale changed to German, but i see
> English Locale (Default Locale) again
> 
> On 10/16/07, Nick Westgate <ni...@key-planning.co.jp> wrote:
>>
>> The docs are out of date, hence the wiki.
>>
>> "Don't effect" is not specific enough. Give us the info to help you.
>> What are you trying do? What are the names of your localized files?
>> How is this event being invoked from your .tml file?
>>
>> Cheers,
>> Nick.
>>
>>
>> Mohammad Shamsi wrote:
>> > i was read in tapestry localization guide that : Tapestry does not yet
>> > support changing the locale, but that will be available shortly.
>> >
>> > but in wiki T5 Howto, i read a guide to changing locale  in tapestry,
>> look
>> > at code :
>> >
>> > @Inject
>> > private PersistentLocale persistentLocale;
>> >
>> > public void onActionFromChangeLocale(String language)
>> > {
>> >         persistentLocale.set(new Locale(language));
>> > }
>> >
>> >
>> > but change locale here, don't effect on my pages :( , any idea ?
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
> 
> 
> -- 
> sincerely yours
> M. H. Shamsi
> 
> 

-- 
View this message in context: http://www.nabble.com/can-i-change-locale-manually-or-not-----tp13213087p16048100.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: can i change locale manually or not ???

Posted by Mohammad Shamsi <m....@gmail.com>.
Hi Nick,

I have just a Start Page, and 2 Property Files (Start.properties,
Start_de.properties)

i have an actionlinke in page to change Locale,

here is my code in Start.java class to change locale :

@Inject
private PersistentLocale persistentLocale;

 public void onActionFromChangeLocale(String language)

>  {
>          persistentLocale.set(new Locale(language));
>  }


when i debug this code, persistenceLocale changed to German, but i see
English Locale (Default Locale) again

On 10/16/07, Nick Westgate <ni...@key-planning.co.jp> wrote:
>
> The docs are out of date, hence the wiki.
>
> "Don't effect" is not specific enough. Give us the info to help you.
> What are you trying do? What are the names of your localized files?
> How is this event being invoked from your .tml file?
>
> Cheers,
> Nick.
>
>
> Mohammad Shamsi wrote:
> > i was read in tapestry localization guide that : Tapestry does not yet
> > support changing the locale, but that will be available shortly.
> >
> > but in wiki T5 Howto, i read a guide to changing locale  in tapestry,
> look
> > at code :
> >
> > @Inject
> > private PersistentLocale persistentLocale;
> >
> > public void onActionFromChangeLocale(String language)
> > {
> >         persistentLocale.set(new Locale(language));
> > }
> >
> >
> > but change locale here, don't effect on my pages :( , any idea ?
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
sincerely yours
M. H. Shamsi

Re: can i change locale manually or not ???

Posted by Nick Westgate <ni...@key-planning.co.jp>.
The docs are out of date, hence the wiki.

"Don't effect" is not specific enough. Give us the info to help you.
What are you trying do? What are the names of your localized files?
How is this event being invoked from your .tml file?

Cheers,
Nick.


Mohammad Shamsi wrote:
> i was read in tapestry localization guide that : Tapestry does not yet
> support changing the locale, but that will be available shortly.
> 
> but in wiki T5 Howto, i read a guide to changing locale  in tapestry, look
> at code :
> 
> @Inject
> private PersistentLocale persistentLocale;
> 
> public void onActionFromChangeLocale(String language)
> {
>         persistentLocale.set(new Locale(language));
> }
> 
> 
> but change locale here, don't effect on my pages :( , any idea ?
> 

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