Processing newline character in function jquery.i18n.prop()
JQuery code is as follows:
alert(jQuery.i18n.prop('message.key'));
The value is specified in the properties file as:
message.key=value is after newline\nValue here
Following output is expected from javascript alert():
value is after new开发者_开发百科line
Value here
The actual output is:
value is after newline\nValue here
I tried different methods by changing value stored in properties file to:
- message.key=value is after newline\\nValue here
- message.key=value is after newline\u000DValue here
But it doesn't work. It displays "\\n" instead
What changes are required to be made to get the desired output?
EDIT: Following code gives desired output in javascript:
alert('value is after newline\nValue here')
But I need to use jquery.i18n.properties for localization
I'm pretty sure you can just go like this (the plugin supports multi-line properties):
message.key1=value is after newline
Value here
message.key2=next value
精彩评论