---
title: Internationalize nodes
description: Internationalization (i18n) of content targets both the end user and the node administrator. Messages sent to users and other UIs can be internationalized.
component: pingam
version: 8.1
page_id: pingam:auth-nodes:i18n-nodes
canonical_url: https://docs.pingidentity.com/pingam/8.1/auth-nodes/i18n-nodes.html
keywords: ["Extensibility", "Nodes &amp; Trees", "Scripts", "Translation"]
section_ids:
  to-localize-callback-node-text: Localize node UI text
---

# Internationalize nodes

Internationalization (i18n) of content targets both the end user and the node administrator. Messages sent to users and other UIs can be internationalized.

You can also internationalize error messages and administrator-facing UI using the same mechanism for better user and admin experience.

Internationalized nodes use the locale of the request to find the correct resource bundle, with a default fallback if none is found.

## Localize node UI text

1. Create a Java resource bundle under the `resources` folder in the Maven project for your node.

   The path and filename must match that of the core class that will use the translated text.

   For example, the resource bundle for the [Username Collector node](https://docs.pingidentity.com/auth-node-ref/8.1/am-only/username-collector.html) is located in the following path: `src/main/resources/org/forgerock/openam/auth/nodes/UsernameCollectorNode`.

   ![The resource bundle for the username collector node as displayed in the project window in the IntelliJ IDE.](_images/auth-node-resource-bundle.png)Figure 1. Example resource bundle

2. Add the properties and strings that the node will display to the user.

   For example:

   ```java
   callback.username=User Name
   ```

3. Create a `.properties` file in the resource bundle for each language your node will display.

   The filename must include the language identifier, as per [rfc5646 - Tags for Identifying Languages](https://datatracker.ietf.org/doc/html/rfc5646).

   For example, for French translations your `.properties` file could be called `UsernameCollectorNode_fr.properties`.

4. Replicate the properties and translate the values in each `.properties` files.

   For example:

   ```java
   callback.username=Nom d'utilisateur
   ```

5. In the core class for your node, specify the path to the resource bundle from which the node will retrieve the translated strings:

   ```java
   private static final String BUNDLE = "org/forgerock/openam/auth/nodes/UsernameCollectorNode";
   ```

6. Define a reference to the bundle using the `getBundleInPreferredLocale` function to enable retrieval of translated strings:

   ```java
   ResourceBundle bundle = context.request.locales.getBundleInPreferredLocale(
           BUNDLE, getClass().getClassLoader());
   ```

7. Use the `getString` function whenever you need to retrieve a translation from the resource bundle:

   ```java
   return send(new NameCallback(bundle.getString("callback.username"))).build();
   ```
