Ways to use getMessage()
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-05-2020 11:49 AM
Recommended way to use getMessage() is
var message = gs.getMessage("This is the message with params {0}", param);
gs.addInfoMessage(message);
Alternately, it can also be written as
var message = "This is the message with params {0}";
gs.addInfoMessage(gs.getMessage(message,param));
and it works.
Is there any problem in second way?
Labels:
5 REPLIES 5
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-06-2020 08:32 PM
I guess it is more to do with translation extractions, which scan code for getMessage() calls and identify strings to translate. In method 1, the string is obvious. In method 2, it is not.