You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Julien Martin <ba...@gmail.com> on 2012/05/03 16:45:12 UTC

Displaying the current locale's language

Hello,

I need to be able to specify the anchor's hreflang attribute in a T5 action
link.
1. There does not seem to be any such attribute for the tapestry action
link. Is there a workaround?
2. I want to use the current locale's language such as "fr" or "en". Here
is what I tried:

@Inject
private PersistentLocale persistentLocale;

@Property
@Persist(PersistenceConstants.FLASH)
private String language;

@OnEvent(EventConstants.ACTION)
void changeLocale(String language) {
persistentLocale.set(new Locale(language));
language = persistentLocale.get().getLanguage();
}

and then ${language}

This result in a blank for the "language" variable.

Can anyone please help?

Regards,

Julien.