Use angular brackets in single quotes with i18n play framework 2.4

I am using i18n messaging of playframework 2.4 java. I have posts in which I need to insert dynamic strings at runtime. Therefore, I used placeholder strings for the environment with brackets <> angular The following is an example of my messages.en file:

message.notification.eventOccured = '<PLACEHOLDER_STRING>' has occured. We''re sorry. 

Now I read this post from my program:

 play.i18n.Messages.get("message.notification.eventOccured").replace("<PLACEHOLDER_STRING>", "Actual String"); 

My expected result:

 'Actual String' has occured. We're sorry. 

But I get:

 'Actual String ' has occured. We're sorry. 

There, a space character is inserted immediately before the second separate quote.

Why is this happening? Does it have anything to do with angular brackets? Also, if there is any workaround to get the desired result.

Thanks.

+5
source share

Source: https://habr.com/ru/post/1259598/


All Articles