Search code examples
gwtlocalizationcontextmenusmartgwtlistgrid

Smart GWT: localization of context menu in listgrid with dynamic title


Im localizing my GWT app, and I want to localize the context menu in my listgrid (SmartGWT). According to the doc, I can set the title of group/ungroup by:

http://www.smartclient.com/smartgwt/javadoc/com/smartgwt/client/widgets/grid/ListGrid.html#setGroupByText(java.lang.String)

public void setGroupByText(String groupByText)

This is a dynamic string - text within \${...} will be evaluated as JS code when the message is displayed, with title available as a variable containing the field title.

Default value returns "Group by " + the field's summary title.

I want to put "Group by XXX" (in different languages), where XXX is the column title, and I should be able to do that with a dynamic string, which evaluates the JS title variable. But how? I need a concrete example, such as:

list.setGroupByText("GROUP BY \\${title}"); // DOES NOT WORK!!!
list.setGroupByText("GRUPPÉR MED \\${title}"); // DOES NOT WORK!!!

Any suggestions?


Solution

  • Ok, I might be very stupid. Here's the answer:

    list.setGroupByText("Group by ${title}"); 
    

    So, in danish that would be:

    list.setGroupByText("Gruppér efter ${title}");