PingFederate Server

Adding custom localized messages to HTML templates

Add localized text to a PingFederate HTML template by defining a message key in a language-pack file and referencing the key in the template. A message key names text that can vary by language or regional setting. Learn more about HTML templates and available template variables in Customizable user-facing pages.

You must use the same complete key in the language-pack file and the template.

Steps

  1. In a text editor, open the <pf_install>/pingfederate/server/default/conf/language-packs/pingfederate-messages.properties file.

  2. Locate the comment header for the template that you want to customize, such as # html.form.login.template.html, and add a unique key beneath it. For example:

    html.form.login.template.loginPlaceholder=Enter email address here
  3. Add the same complete key to each locale-specific message file that requires a translation. Replace the default value with the translated text for that locale.

  4. Open the HTML template in a text editor. In this example, the template is <pf_install>/pingfederate/server/default/conf/template/html.form.login.template.html.

  5. In the template, insert the complete message key where you want the localized text to display:

    $templateMessages.getMessage("html.form.login.template.loginPlaceholder")
  6. Restart PingFederate before you test the change. PingFederate caches localized UI strings when it starts.

    In a clustered PingFederate environment, copy the updated language-pack and template files to each node. Restart each node after you update its language-pack files, and test the change after all nodes restart.

Learn more about language-pack localization and caching in Localizing messages for end users.

For testing, you can temporarily disable language-pack caching by changing the value of the cache-language-pack-messages parameter to false in the <pf_install>/pingfederate/server/default/data/config-store/locale-options.xml file. Set the value to true and restart the server after testing is complete.