OBLYTECH Logo
OBLYTECH Logo

Custom Labels for Translated Page Text

Move page text into custom labels when several screens or a translator need the same wording and should change it in one place. Leave text in the page when it fits a single layout or changes with record data. Test each label change in the target language before users see it.

Deciding whether text belongs in a label

The first test is who will change the words. If a translator or a local content team owns the wording, a label gives them one place to edit and one key to match against. If one developer wrote a sentence for a single screen and nobody else will touch it, moving it out adds a lookup and a second place to check, with little gain.

Text that usually earns a label tends to fall into a few groups:

  • Button and link captions that appear on more than one component
  • Field help text and validation messages shared across screens
  • Section headings that must read the same way wherever they appear
  • Status and notice messages that repeat through several flows

Text that usually stays in the page is copy written for one layout at one moment in a journey, such as a short introduction on a single tab. Editorial content that a team publishes often and wants to manage in a content tool also sits better outside the label set. In many teams a label change travels through the same release path as code, so a wording tweak that needs a deployment is a poor fit for something that changes weekly.

Naming keys so later copy changes stay cheap

A key should describe what the text does and where it sits, not the English words it holds. A key such as button.order.submit survives a copy change, because the wording can move from “Submit” to “Send order” without a rename. A key named after its current sentence forces a rename across each translated language the moment the English changes, and each translation has to be re-matched to the new name by hand, which is where mismatches creep in.

Set the following conventions before the first key is created:

  1. Name the key by its purpose and location, using a short prefix for the component type.
  2. Write the source value in plain English and add a context note that states the screen and who reads it.
  3. Record each screen and component that uses the key, so a reviewer can see the effect of a change before approving it.
  4. Agree how plural and gendered forms will be handled before the first translation batch starts.

The last step is the one teams skip. A label that reads “1 case” in English may need several forms in another language. A single key holding one fixed string cannot carry those forms, so the design choice has to be made before translation starts, not after. If the source copy comes from an outside system rather than from your own org, the integration design also decides which side holds the master wording. The options are covered in Salesforce integration architecture.

Handling sentences built from record values

A sentence such as “You have 3 open cases” tempts a developer to join three pieces of text in code. That works in English and breaks in languages that place the count, the noun and the verb in a different order. The safer pattern is one label with a named placeholder for the value, so the translator can move that value to wherever the target language needs it.

Give translators a note for each placeholder that says what the value is, roughly how long it can be and whether it can be blank. A translator who sees just a token name will guess, and the guess often reads wrongly on the screen. Keep the placeholder inside one label rather than split across two keys, because a split sentence cannot be reordered by the translator.

Developers who look up labels from triggers or batch jobs should read the bulk-safe trigger checklist for developers before writing the lookup code, since per-record work repeated across a large data load is the kind of pattern that deserves a check before release.

Dates, times and currency are a separate case. Format those through the platform’s locale handling and keep just the surrounding words in the label. A pattern written into the text fixes the output to one locale and breaks users who work in another.

Testing a label change before users see it

Many label problems show up in testing, and testing needs a repeatable process rather than a look at the spreadsheet. A translation can look correct in a list and still overflow a button on a narrow layout, or read oddly next to the field label it sits beside.

  1. Make the change in a sandbox or a staging copy of the org, not in production first.
  2. Set a test user to the target language and open each screen listed against the key.
  3. Check the narrowest layout you support. Longer translations push captions onto a second line or past the edge of their container.
  4. Search each screen for untranslated text and anything that looks like a raw key name, since a gap in one language is easy to miss on a long form.
  5. Ask the translator to review the text in context on the live screen, not in a spreadsheet row.
  6. Repeat the open-and-check pass on any screen where record data changes the length of the text.

Write down the result of each check next to the change in your log. A pass recorded against a specific screen and language is far more useful later than a general note that the labels were tested.

Running the handoff between developers and translators

Label trouble often starts at the handoff. A developer adds a key, a translator starts work the same day, and the English value changes twice before the batch returns. The fix is a freeze point. Once a release’s keys are set, the English wording for those keys stops changing until the translations come back.

The handoff needs three things: an export of the keys with their context notes, a named owner for the English source, and a log of changes made after the freeze. A short log is enough. Record the release, the key, the old value and the new value. When a change is needed after the freeze, the developer raises it, the owner decides, and the translator receives the single changed line rather than a fresh file.

Where a label change also alters which automated messages or steps run, note that in the same log and check the flow against the design covered in Salesforce automation workflows before the release goes out.

For help planning this work, see Salesforce implementation.

Keeping the label set tidy after go-live

After go-live the label set drifts. Keys are added for a feature that was later removed, and copy gets edited directly in the page when someone is in a hurry. A review at each release catches both. Compare the keys referenced on screens against the keys in the set, and list any key that nothing references.

Before a release that adds many new screens, review the combined change, including the screens, the automations and the labels, as one batch. Where new automation runs alongside the new text, check that code against the guidance in Salesforce governor limits for admins, because the risk sits in the code that runs, not in the wording.

Remove unused keys after confirming that no translation batch or report depends on them. Keep the removed keys in the change log so a rollback can restore them.

Questions about fallback, rollback and formatting in labels

What should happen when one language has no translation for a key?

Decide this before the release, not during it. Your team needs to agree what a user sees when a translation is missing, whether that is the source wording or a visible gap, because each outcome reads differently. For public-facing screens, treat a missing translation as a blocker for that release. For internal screens, a short list of accepted gaps can be tracked and cleared in the next cycle.

How do I roll back a wording change that caused a problem?

Keep the previous value in the change log beside the new one. Rolling back means restoring the earlier English wording and, where the translations were updated, the earlier translated line. Do not delete the key during the rollback. Restoring the wording on the existing key is a single edit, while recreating a removed key means re-entering every translation by hand.

Should a label hold a whole paragraph of text?

Short labels are easier to translate in context and easier to review on a small screen. A paragraph held in one label means a translator must handle the whole block at once, and a change to one sentence reopens the entire string. When a paragraph is genuinely shared, split it into labeled sentences the translator can reorder, and keep the paragraph structure in the page itself.

Can labels hold dates, numbers and currency formats?

Keep formats out of label text. Number, date and currency patterns belong to the locale the user is working in, so a label should hold the words around a value and take the value as a placeholder. Writing a format into the label is the quickest way to get a correct screen for one locale and a broken one for the rest.

How often should unused labels be reviewed?

Tie the review to the release calendar rather than to a fixed interval. Run the unused-key check at the same point in each cycle, after the new keys are added and before the translations are requested. Teams that wait until clutter is noticed tend to find old keys already sent to translators.