Define Variables in Your Dynamic Phrases

Condense similar phrases into one phrase using the Localize dashboard.

The Define Variables feature makes it easy to identify phrases that contain dynamic content (such as dates, names, email addresses, etc.) so they can be merged into a single phrase for translation - right from within the Localize dashboard!

As a result, you don't have to ask your developers to add tags in your HTML, and your translators only have to translate the phrase one time - saving you time and money!

📘

Bonus: Set it and forget it!

After you've defined variable(s) in a dynamic phrase, any new phrases that are found that match the pattern in that phrase will be ignored, and won't be brought in as a new phrase!

View the tutorial video, or follow the instructions below to define variables in your dynamic phrases.

Identify dynamic phrases

The first step is to identify phrases in your project that contain mostly the same content, but with perhaps 1 or 2 pieces of dynamic data.
While you are looking through new phrases in your Pending bin, look for patterns in the phrases.

Once you've identified a group of similar phrases, click the caret in the top/right corner of one of the phrases and select the Define variables option from the pull-down menu.

1. Define variables

The first step is to define your variables.

a. Highlight the dynamic content

Follow the on-screen instructions to highlight the dynamic content in the phrase.

b. Name the variable

Next, give the variable a name in the Pending variables panel, and click Save.

Your new variable is saved, and the dynamic content in your phrase is replaced with the variable name.

c. Repeat for other dynamic content

You can repeat the process for other dynamic content in your phrase as needed.
Once done, click the Continue button.

2. Review matching phrases

a. Review phrases

Matching phrases will be displayed, allowing you to see which phrases will be merged into one phrase.

📘

All Bins are Searched

Localize will search for matching phrases in all of your phrase bins. So while you may have spotted 4 in your Pending bin, there may be others in your Published or Deprecated bins.

Localize will find all of them, and merge them all into one phrase.

b. Click I Understand

When ready, click the I Understand button.

c. Click Continue

Next, click the Continue button.

3. Confirm changes

Review the changes that will be made.

❗️

Phrases will be deleted

You should verify that you want the phrases to be merged, since the merging process completely deletes the duplicate phrases from your Project.

❗️

Translations will be deleted

When the phrases are merged, ALL translations will be deleted for the phrases, even for the phrase that remains with the variable in it.
If you need to, first save the translation somewhere outside of the Localize dashboard.

When you click the Confirm Changes button, your phrases will be merged into one new phrase. and you'll be returned to the Published phrases bin.

📘

Easily Find Phrases with Variables

When a variable is defined in a phrase, Localize will add the lz-dynamic-phrase system label to the phrase, making it very easy to find all phrases with variables by using the labels filter.

📘

Some Limitations

The Define Variables feature cannot be used in phrases where one or more of the following is true:

  1. Phrases that contain HTML markup
  2. Phrases where the dynamic content is the first or last word in the phrase

Updated about a month ago


Define Variables in Your Dynamic Phrases


Condense similar phrases into one phrase using the Localize dashboard.

Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.