You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Juergen Donnerstag (JIRA)" <ji...@apache.org> on 2010/07/10 11:04:50 UTC

[jira] Commented: (WICKET-2910) Ability to pass Locale into getString function

    [ https://issues.apache.org/jira/browse/WICKET-2910?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12887014#action_12887014 ] 

Juergen Donnerstag commented on WICKET-2910:
--------------------------------------------

you could create a very simple mail page, assign it the fixed locale and go from there. See below

It has been changed, because the whole localization depends on more than just locale. There is also style and variation. And adding all these parameters to a serious of interfaces and passing this rather long list of parameters along has always been bit of a pain. But I understand your use case and understand that temporarily setting the session locale is not an especially nice solution. Essentially it's a trade off. I think the solution is clean and I hope that the solution below is convinient and simple enough for your rather (rare) use case.

		Component comp = new MailPage()
		{
			@Override
			public Locale getLocale()
			{
				return Locale.GERMANY;
			}
		};

		String option = localizer.getStringIgnoreSettings("dummy", comp, null, null);


Did you ever consider creating your email content with Wicket? The markup associated with the MailPage would be your mail body. You can use all of WIckets features. You simply need to retrieve the rendered output as string and your are done.


> Ability to pass Locale into getString function
> ----------------------------------------------
>
>                 Key: WICKET-2910
>                 URL: https://issues.apache.org/jira/browse/WICKET-2910
>             Project: Wicket
>          Issue Type: New Feature
>          Components: wicket
>            Reporter: Marieke Vandamme
>
> Locale#public String getString(final String key, final Component 
> component, final IModel<?> model, final Locale locale, final String 
> style, final String defaultValue)  is deprecated.
> Can this functionality be readded? 
> See mailinglist: http://apache-wicket.1842946.n4.nabble.com/get-resource-translation-with-specific-locale-tp2247162p2247162.html
> Thanks, Marieke Vandamme

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.