Closed Bug 1628362 Opened 6 years ago Closed 4 years ago

Create a POC Fluent recipe to migrate specific HTML nodes from a legacy string

Categories

(Localization Infrastructure and Tools :: Fluent Migration, task)

task
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: flod, Assigned: eemeli)

References

Details

Once bug 1626976 is fixed, we still need to write code in the recipe to migrate specific nodes to new Fluent messages.

Example of legacy string:

<!ENTITY inadequateSecurityError.longDesc "<p><span class='hostname'></span> uses security technology that is outdated and vulnerable to attack. An attacker could easily reveal information which you thought to be safe. The website administrator will need to fix the server first before you can visit the site.</p><p>Error code: NS_ERROR_NET_INADEQUATE_SECURITY</p>">

It should be possible to migrate this to:

inadequate-security-error-desc = <span data-l10n-name='hostname'></span> uses security technology that is outdated and vulnerable to attack. An attacker could easily reveal information which you thought to be safe. The website administrator will need to fix the server first before you can visit the site.
security-error-code = Error code: { $errorCode }>

The code should parse the original HTML and return the text of a specific node in the DOM fragment.

Not sure at which point replacements for data-l10n-name or variables should happen.

Summary: Create a POC Fluent recipe to migrate HTML notes from a legacy string → Create a POC Fluent recipe to migrate specific HTML nodes from a legacy string
Blocks: 1734217

The bug_1734217_aboutNetError.py migration script that's a part of this patch includes a custom transformer that allows for migrating a single HTML-contentful message to multiple Fluent messages:

https://hg.mozilla.org/try/file/2d88db20f4031bad01465087a86a595769b5bc3b/python/l10n/fluent_migrations/bug_1734217_aboutNetError.py

Assignee: nobody → earo
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.