Reply To: regarding i18n configuration

Splash Forums Rewrite Users regarding i18n configuration Reply To: regarding i18n configuration

#25977

zozan
Participant

I got another problem though. I can type both myapp/lang/path and myapp/path.xhtml in the address bar and get to path.xhtml.
Here is my configuration:

.addRule()
             .when(Direction.isInbound().and(Path.matches("/{lang}/{path}").withRequestBinding()))
             .perform(Forward.to("/{path}.xhtml"))
             //(Join.path("/{lang}/{path}").to("/{path}.xhtml"))             
             .where("path").transposedBy(LocaleTransposition.bundle("com.myapp.bundles.text", "lang"))             
             .where("lang").matches("en|ar") 
             
             .addRule()
             .when(Direction.isOutbound().and(Path.matches("{path}.xhtml")))
             .perform(Substitute.with("/{lang}/{path}"))
             .where("path").transposedBy(LocaleTransposition.bundle("com.myapp.bundles.text", "lang"))             
             .where("lang").matches("en|ar")