--- name: migrating-ui-strings-to-fluent description: Use when moving comm-central UI strings from legacy properties or DTD resources (string bundles, preference panes, dialogs) into Fluent (FTL), when reviewing such a migration or its recipe, or when updating the consumers, packaging, or tests involved in a string move. Not for copy edits confined to existing FTL messages. --- # Migrating UI Strings to Fluent Produce a complete migration: Fluent resources, every runtime consumer, the downstream locale migration recipe, packaging/search metadata, and locale-independent tests must agree. Preserve the user's requested scope; an assessment request is read-only, while an implementation request includes proportional validation. ## Inventory before editing Read the repository instructions, then use `rg` to trace: - every legacy definition and consumer; - tests that assert the old English output; - `jar.mn`, XHTML includes, and other packaging entries; - `search-l10n-ids` and similar indirect references; - existing Fluent IDs or migration transforms that might collide with the proposed IDs; - an existing Fluent message that already covers the same UI state with newer copy. A legacy string that is byte-identical to a pre-rename FTL string is a stale twin: reconcile with the newer message instead of migrating the old wording under a new ID. Classify each use by what the caller actually needs: static DOM localization, a dynamically created element, or a JavaScript string. Remove dead consumers instead of migrating strings that no longer serve a purpose. ## Design messages for their consumers Choose the Fluent shape from the target element or API, not from the legacy properties shape. - Static markup: use `data-l10n-id` and arguments, with the element's expected attributes. - XUL menu items: normally use `.label`, plus `.tooltiptext` when the UI previously set one. - XUL labels: a message value renders as the label's text content, while a `.value` trait is rendered from the `value` attribute through `::before`. An element must use one mechanism consistently — a plain-value message applied to a node that already has a `.value`-trait translation leaves the earlier text content in place and displays both strings side by side (the reverse direction is safe, because Fluent unsets the stale attribute). - HTML text containers: a message value is often appropriate. - HTML `` and `