I understand that, but in this case a IModel or IConverter seems
appropriate since I'm only interested in the string representation of a
date, not page or component markup.
However, in doing this, you seem to lose some of Wicket's nice
localization conventions.
On 10/30/10 11:36 PM, vineet semwal wrote:
afaik you should only have property files corresponding to your components
,pages or application.
however if you just want to do your own way you can always use get your
resourcebundle.
On Sun, Oct 31, 2010 at 11:51 AM, 7zark7<[email protected]> wrote:
Hmm, that didn't seem to find a property if I have the property file
specific to the model class, e.g.:
NiceDateModel.properties
However, I see now there's some classes such as:
IComponentAssignedModel<java.lang.String>
or perhaps I should subclass StringResourceModel, etc.
Will look into it further,
Thanks
On 10/30/10 4:53 AM, 7zark7 wrote:
Thank you, I'll give that try!
On Oct 30, 2010, at 1:51 AM, "Bas Gooren"<[email protected]> wrote:
The component parameter can be null.
e.g. if you look at getObject() in the ResourceModel class:
return
Application.get().getResourceSettings().getLocalizer().getString(resourceKey,(Component<String>)null,
defaultValue);
It calls Localizer#getString with the resource key and optionally a
component.
Sebastian
----- Original Message ----- From: "7zark7"<[email protected]>
To: "Wicket"<[email protected]>
Sent: Saturday, October 30, 2010 8:47 AM
Subject: get localized string from Model class?
Hi,
I am writing a IModel<String> implementation which formats Dates in a
particular way.
I would like the text to be in localized properties files, however I
can't seem to leverage anything in Wicket for this. Localizer expects a
component to be passed to its getString methods, which I do not have a
reference to.
Anyone have ideas or done similar?
Thanks
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]