Hi Jose,
On 04/10/13 05:59, Jose Blanco wrote:
> I would like to store this in the messages.xml file
>
> <message key="xmlui.RequestItem.Test1">test 1</message>
> <message key="xmlui.RequestItem.Test2">test 2</message>
>
> And then create a string like this
> private static final Message T_Test1 =
> message("xmlui.RequestItem.Test1");
>
> private static final Message T_Test2 =
> message("xmlui.RequestItem.Test2");
>
> String msg = T_test1 + "something else" + T_test2
>
> How do can I do this? How can I convert Message to string?
Can you go back a step and tell us what you're actually trying to
achieve? Your way of constructing the msg string looks like an extremely
bad idea to me. Word order for the same phrase differs across languages;
your concatenation is forcing a particular word order, which means while
this may work in English, it may break in other languages. You really
should use parameterisation, like helix84 told you, when you need to
construct a single message from multiple components. That way you can
place the parameter placeholders ({0}, {1} etc) exactly where they need
to be in each language you support.
cheers,
Andrea
--
Dr Andrea Schweer
IRR Technical Specialist, ITS Information Systems
The University of Waikato, Hamilton, New Zealand
------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60134791&iu=/4140/ostg.clktrk
_______________________________________________
DSpace-tech mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dspace-tech
List Etiquette: https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette