Skip to main content

Phrase Substitution in UI

This topic describes how to make both simple and advanced phrase substitutions in the user interface.

Fastpath

Admin Console: System > Settings > Phrase Substitutions

How it Works

All substitutions are made at run time. The application keeps track of the phrases you want displayed and inserts your specified phrases in place of the default ones when users view applicable pages. Default phrases originate from internationalization (i18n) properties files used for localization. Your substitutions are linked to a specific theme, allowing for global changes or adjustments for particular parts of the user interface.

In the backend, these substitutions are remembered as "substitution rules" that utilize regular expressions for fine-tuning your changes.

Note: Because your phrase substitutions are part of your theme, they are overridden if you change your site’s theme. When you upgrade, they are overwritten, and you must recreate them.

Overview of Simple and Advanced Phrase Substitution

The simple substitution mechanism enables direct replacement of common phrases. For example, terms like "Documents" and "Discussions" can be renamed to "Articles" and "Conversations."

While the simple substitution accounts for upper- and lower-case versions, it does not always ensure grammatical correctness. For instance, substituting "article" for "document" might lead to awkward constructions—like "Create a article or upload a file" instead of "Create an article or upload a file."

Making Simple Substitutions

To define simple rules, follow these steps:

  1. In the Admin Console, navigate to System > Settings > Phrase Substitutions.
  2. Choose the relevant theme and locale for your substitution. A list of phrases available for substitution is presented.
  3. If the desired phrase is listed, enter your alternatives for both singular and plural versions.
  4. Click Save to complete the substitution. Changes take effect immediately without needing to restart the application or server.

After saving, you can view the rules on the Phrase Substitutions page to see the details of your substitution.

Simple Phrase Substitutions

Note: Always test changes on an instance of the application that isn't in active use to avoid disrupting users.

Creating Advanced Substitution Rules

To create more precise substitution rules, use the following steps:

  1. In the Admin Console, go to System > Settings > Themes.
  2. Click the edit icon for the theme to which you want to add the rule.
  3. On the Edit Theme page, click Edit Rules.
  4. On the Phrase Substitution Rules page, click Add Rule.
  5. Specify the details for the new rule, including:
Rule optionValueDescription
TargetValue or keySpecify if you seek to replace a pattern within i18n values or keys.
OperatorEquals, Contains, Starts With, Ends With, or Regular ExpressionThe operator applied to the substitution.
PatternThe original stringThe exact text that should be replaced.
Replace WithThe replacement stringThe text that will substitute the pattern.
  1. After completing the configuration, click Save.

Viewing and Editing Substitution Rules

On the Phrase Substitution Rules page, you can:

  • Edit an existing rule, specifying what you're substituting and what it will be replaced with.
  • Add exceptions to existing rules.
  • Delete substitution rules.
  • View the results of your substitutions to see the context of the changes.

Advanced Phrase Substitution Rules View Rule Results