I like your question because it was creative, at least for me :) Check out this approach, which it works for me:
conf/routes
GET /help controllers.Application.helpIndex(lang = "en")
GET /hilfe controllers.Application.helpIndex(lang = "de")
GET /help/:id controllers.Application.helpTopic(lang = "en", id: Long)
GET /hilfe/:id controllers.Application.helpTopic(lang = "de", id: Long)
controllers/Application.java
public static Result helpIndex(String lang) {
return ok("Display help index in " + lang.toUpperCase());
}
public static Result helpTopic(String lang, Long id) {
return ok("Display details of help topic no " + id + " in " + lang.toUpperCase());
}
views/someView.scala.html
<a href="@routes.Application.helpIndex("en")">Help index</a><br/>
<a href="@routes.Application.helpIndex("de")">Hilfe index</a><br/>
<a href="@routes.Application.helpTopic("en", 12)">Help topic no 12</a><br/>
<a href="@routes.Application.helpTopic("de", 12)">Hilfe topic no 12</a>
source
share