---
title: Adding custom localized messages to HTML templates
description: How to define a custom message key in a language pack and reference it in a PingFederate HTML template so the text is localized.
component: pingfederate
version: 13.1
page_id: pingfederate:administrators_reference_guide:pf_adding_custom_localized_messages_html_templates
canonical_url: https://docs.pingidentity.com/pingfederate/13.1/administrators_reference_guide/pf_adding_custom_localized_messages_html_templates.html
llms_txt: https://docs.pingidentity.com/pingfederate/llms.txt
docs_for_agents: https://developer.pingidentity.com/build-with-ai/docs-for-agents.md
revdate: October 6, 2026
section_ids:
  steps: Steps
---

# 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](pf_custom_user_facing_pages.html).

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:

   ```xml
   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:

   ```xml
   $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](pf_local_message_end_users.html).

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.
