Could anybody explaine how to remove the generated by Tapestry locale prefix
in the url or just avoid id?
When switching the locale like this(took from the very known exmaple):

public class Layout {
@Inject
    private PersistentLocale persistentLocale;

    @Inject
    private Locale currentLocale;

    @Persist
    private String localeLabel;

public String getLocaleLabel() {
        if (localeLabel == null) {
            if (currentLocale.equals(Locale.FRENCH)) {
                localeLabel = new Locale("en").getDisplayName(Locale.ENGLISH);
            } else {
                localeLabel = new Locale("fr").getDisplayName(Locale.FRENCH);
            }
        }
        return localeLabel;
    }

    @OnEvent(component = "switchlocale")
    void changeLocale() {
        localeLabel = currentLocale.getDisplayName(currentLocale);
        if (currentLocale.equals(Locale.FRENCH)) {
            persistentLocale.set(Locale.ENGLISH);
        } else {
            persistentLocale.set(Locale.FRENCH);
        }
    }
Tapestry always adds a locale prefix to the url liek that:

http://my_host/fr/home

http://my_host/en/home

The only trace I found in Tapestry API is to add the folowing in APPModule:

configuration.add(SymbolConstants.ENCODE_LOCALE_INTO_PATH, "false");

It seems that SymbolConstants.ENCODE_LOCALE_INTO_PATH is set to true by
default. If overriden to "false" I should provide a LinkCreationListener
(registered with the LinkCreationHub) in order to add the locale as a query
parameter (or provide some alternate means of persisting the locale between
requests). 

How to do that? Thanks.


--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Internationalization-How-to-remove-locale-prefix-in-the-URL-tp5102755p5102755.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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

Reply via email to