Are there any tools to assist with the internationalization of Strings within JSP files?
Most IDEs (for example, NetBeans) offer such a feature for Java code. However, in the case of NetBeans, no such feature exists for JSP files.
With gettext, for example, there is are various tools out there that assist with extracting text Strings from code. Something similar for JSP would be great!
I hope no-one minds if I bump an old question...
When faced with the same problem, I put together (a) a method for localising strings in JSPs in the Gettext style (keeping English in the source JSP) and (b) an Ant task which can find such strings in JSPs and generate a Gettext POT file.
(a) is provided by WebGettext, which provides an EL resolver for expressions such as ${messages["Hello {0}"][username]}. The resolver looks up a translation, for the requesting user's locale, and substitutes any parameters using MessageFormat.
(b) is provided by Regex2PotTask, which is a bit like xgettext but for a configurable regex expression rather than C, Java, Perl, etc, function calls such as gettext("my string").
Tennera's home page is here.
Example JSP project - see RUNNING.txt
It's all a bit rough at present, but I think the basics are all there. If someone expresses interest, I might even be motivated to document it "properly"...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With