Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

[Wicket] Localization of page layout

 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Eelco Hillenius
author
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So what's the role of (and relationship between) borders and markup inheritance in all of this?
 
Eelco Hillenius
author
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic