I'm working on a patch for RequestCopy, and I have some global strings
I want to declare so that other users can then change these strings.
I thought messages.xml would be the place to do that. I want to use
them as Strings not Message type.

Ideally, I would have these in some centralized location (
messages.xml, I thought )

String Part1 = "whatever";
String Part2 = "some text";

In an aspect file, I create a string based on Part1 and Part2,
something like this:

String Final_message = Part1 + " : " + Part2;

Sorry for being so hardheaded about this.

-Jose

On Thu, Oct 3, 2013 at 4:39 PM, Andrea Schweer <[email protected]> wrote:
> 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

Reply via email to