i18n/localization - multiline text in .properties file

624 views
Skip to first unread message

Vitaly Trifanov

unread,
Dec 15, 2011, 2:43:14 PM12/15/11
to Google Web Toolkit
I'm using UiBinder with GWT localization features to create UI of my
application.
So, I have:
- View.ui.xml file with directive "<ui:with field="messages"
type="com.csn.core.resources.UiMessages"/>"
- usage of "messages.welcomeText" property inside <g:HTML> element at
this page.

Problem is that welcomeText is multiline. I've tried different
variants for line breaks: "<br/>", "\n","\r" , but it's always
displayed as one-line-text.
Which line separator should I use to make UiBinder display text as
several lines?

By the way, is there any way to create multi-line label in GWT? Now
I'm trying to use g:HTML for these purposes and it's a bit
uncomfortable.
Of course, I may use TerxtArea, but I want the text to look line just
plain text at html page, but not like text-in-readonly-textarea :)

Than ks in advance!
Vitaly.

Jaroslav Záruba

unread,
Dec 16, 2011, 2:46:17 AM12/16/11
to google-we...@googlegroups.com
\ works in "regular" Java, should in GWT too
cheers
  Jaro

Frank

unread,
Dec 16, 2011, 3:54:01 AM12/16/11
to Google Web Toolkit
I think Jaro is meaning something else than you are asking... (\ is
used if you want to type multiple lines in the I18N file cause
otherwise the lines get to long in your editor)

I never use UIBinder but in normal GWT you use "<BR/>" in an HTML
widget for multiline.
The HTML widget however has a wordwrap property which can be setted by
setWordWrap. Be sure to set this to true.

Frank

Reply all
Reply to author
Forward
0 new messages