December 21, 2007 —
Virtually all text strings in the portal have been extracted to XML files, mostly for internationalization. Check out %PORTAL_HOME%ptportal6.1i18nen for these files. Why should you care? Here are a couple reasons:
- I had a customer who didn’t like calling Communities Communities. They wanted to call them “Spaces” or something like that. By simply doing a search and replace in these files, they were able to do that.
- Customizing the text that shows up on the login form is also a big feature (explaining to users which Auth Source to pick, for example); simply find the text in ptmsgs_portalbrowsingmsgs.xml, and replace it with whatever you want.
- New files can be created here that allow you to create your own string files for use in your own code. That way, text can be easily changed later as needs evolve.
- If you know the index of the string you want to use, you can use Adaptive Tags to get the portal to transform it for you, including internationalization support. For example, suppose you’re writing a login portlet; take this section of ptmsgs_portalbrowsingmsgs.xml:
… and instead of putting the text “Create An Account” in your HTML, you could use:
Then, this Logic Tag will automatically transform the text in your portlet into the appropriate language for the string with an ID of 1 (“Create An Account”).