This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Other Application Frameworks and the fly likes [Wicket] Localization of page layout Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Other Application Frameworks
Bookmark "[Wicket] Localization of page layout" Watch "[Wicket] Localization of page layout" New topic
Author

[Wicket] Localization of page layout

Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
As a sort of continuation of this earlier question, I'd be curious to hear what kind of an approach should one take with Wicket to support layout-level localization, e.g. when bits of the page need to be positioned to a different place for certain locales or when text content needs to flow right-to-left for Arabic users?


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Eelco Hillenius
author
Ranch Hand

Joined: Apr 23, 2008
Posts: 37
Originally posted by Lasse Koskela:
As a sort of continuation of this earlier question, I'd be curious to hear what kind of an approach should one take with Wicket to support layout-level localization, e.g. when bits of the page need to be positioned to a different place for certain locales or when text content needs to flow right-to-left for Arabic users?


So the easiest and often preferable way to go for localization is to use constructs like <wicket:message>. However, is that is not sufficient, you can take advantage of the way Wicket loads resources. For instance if you'd have MyPage.html and MyPage_nl.html and the user's locale is nl_NL, the MyPage_nl.html would be loaded.

See for instance the org.apache.wicket.examples.pub and org.apache.wicket.examples.pub2 examples for an illustration on this, and see org.apache.wicket.examples.forminput where this is used for just images (the flag icon).
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
So what's the role of (and relationship between) borders and markup inheritance in all of this?
Eelco Hillenius
author
Ranch Hand

Joined: Apr 23, 2008
Posts: 37
Originally posted by Lasse Koskela:
So what's the role of (and relationship between) borders and markup inheritance in all of this?


They abide the same rules of markup loading, but have no special meaning for localization. Though you could use it for that if you implement e.g. borders in a locale specific way.
Martijn Dashorst
author
Ranch Hand

Joined: Jan 23, 2006
Posts: 58
Originally posted by Lasse Koskela:
So what's the role of (and relationship between) borders and markup inheritance in all of this?


Wicket favors the markup specific to a locale over the generic one. If you have:

BasePage.html
BasePage_fi.html

and

ConcretePage.html
ConcretePage_fi.html
ConcretePage_nl.html

and a user with local fi comes along, he'll get ConcretePage_fi.html and BasePage_fi.html, if a dutch guy with locale nl comes along, he'll get ConcretePage_nl.html and BasePage.html. If someone else comes along with a different locale, they'll get the non-localized pages.
Tomasz Prus
Ranch Hand

Joined: May 20, 2008
Posts: 73
Hi Lasse, i have question for You. What You can say about Wicket testability? Did You have any problems, with Wicket's mocks for example? Because, i did. Maybe, You can write tutorial about this
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
I only have a limited first-hand experience with Wicket (although it's extensively used at Reaktor) but, having said that, I've found Wicket quite easy to work with, testing-wise.

Part of this is thanks to the built-in support in the form of WicketTester and part of it is thanks to WicketBench, an Eclipse plugin originated by my colleague, Joni Freeman.
Tomasz Prus
Ranch Hand

Joined: May 20, 2008
Posts: 73
I found problem with testing during test form fields validation, some strange issues with ResquestCycle but maybe i forget about something and don't understand everything yet.
My cousine Jakub Jarvenpaa works in Reactor. If You will see him ask him why don't answer for my emails. He promise that send me one "Test Driven" book with Your autograph

I know TDD and Wicket from Jakub. He introduce me in Java programming. Everything he learnt me I implement in our company in Poland.
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
What a small world! Now that you mentioned Jakub, I vaguely remember him telling about his cousin in Poland who's also in IT - that must've been you, then
 
 
subject: [Wicket] Localization of page layout
 
Similar Threads
WA #1.....word association
Wicket in Action: Internationalization and Localization
Struts2 Issue with localization: Messages not picked up from properties file for forward actions.
Need i18n implementation in JSP
serialization problems -whether it is a serious matter?