Closed Bug 1444969 Opened 5 years ago Closed 5 years ago

Fluent: home-page-header was migrated using the wrong string

Categories

(Firefox :: Preferences, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
Firefox 61
Tracking Status
firefox61 --- fixed

People

(Reporter: flod, Assigned: flod)

References

Details

Attachments

(1 file)

home-page-header = Home page

But it was migrated using

FTL.Message(
    id=FTL.Identifier('home-page-header'),
    value=COPY(
        'browser/chrome/browser/preferences/main.dtd',
        'startupUserHomePage.label',
    )


startupUserHomePage.label is "Show your home page".

The string to mgirate was homepage2.label
Note: at this point we need a new string to replace home-page-header, and the related migration.

@zibi
Is it something you can take a look at? We'll also need uplift to beta at this point.
Flags: needinfo?(gandalf)
Summary: home-page-header contains the wrong string → Fluent: home-page-header was migrated using the wrong string
Is there no way for us to migrate the main.dtd `homepage2.label` onto `home-page-header` assuming noone touched that string since it landed?

Sure, I can write a patch, but it seems like it's likely possible to fix the issue across all locales (I'm happy to land into all of them if that's the easiest way :)).
Flags: needinfo?(gandalf) → needinfo?(francesco.lodolo)
(In reply to Zibi Braniecki [:gandalf][:zibi] from comment #2)
> Is there no way for us to migrate the main.dtd `homepage2.label` onto
> `home-page-header` assuming noone touched that string since it landed?

No, migration doesn't overwrite an existing string in the FTL file, for good reasons (you would lose any change done post migration).

> Sure, I can write a patch, but it seems like it's likely possible to fix the
> issue across all locales (I'm happy to land into all of them if that's the
> easiest way :)).

How? I'm open to suggestions…

For the record, we're going to hit a second issue here: let's say you remove home-page-header and add home-page-header2, then write the correct migration.

If we run the migration, it will create home-page-header2 correctly, but it will also remove home-page-header, because it's not available in the en-US file. It's a relatively small problem here, since we plan to uplift the patch ASAP, but it's going to be reported as missing on Beta until then, displayed in English, etc.
Flags: needinfo?(francesco.lodolo)
I didn't mean migration script. I meant two steps:

1) go through https://hg.mozilla.org/l10n-central/* and check if anything touched the preferences.ftl#home-page-header after it originally landed

If we'll learn that no, nobody in no locale, touched this line then:

2) go through https://hg.mozilla.org/l10n-central/*, take main.dtd#homepage2.label and apply it on preferneces.ftl#home-page-header.

without changing IDs, just fix a mistake we made.
(In reply to Zibi Braniecki [:gandalf][:zibi] from comment #4)
> I didn't mean migration script. I meant two steps:
> 
> 1) go through https://hg.mozilla.org/l10n-central/* and check if anything
> touched the preferences.ftl#home-page-header after it originally landed

I don't think this is needed, and it's safe to assume the value in homepage2.label can replace the existing content of home-page-header.

> 2) go through https://hg.mozilla.org/l10n-central/*, take
> main.dtd#homepage2.label and apply it on preferneces.ftl#home-page-header.
> 
> without changing IDs, just fix a mistake we made.

I'm missing "how" you would make this happen.
OK, I'm running a script that removes the string and re-run the translation. Using this bug to fix the migration code.
Assignee: nobody → francesco.lodolo
(In reply to Francesco Lodolo [:flod] from comment #6)
> OK, I'm running a script that removes the string and re-run the translation.

s/translation/migration, e.g.
https://hg.mozilla.org/l10n-central/de/rev/7374fdf7e2854f221822e806bf33d96c258b139f
Comment on attachment 8958176 [details]
Bug 1444969 - Fix Fluent migration code for home-page-header

https://reviewboard.mozilla.org/r/227124/#review232920

lgtm! Thank you Flod :)
Attachment #8958176 - Flags: review?(gandalf) → review+
Pushed by francesco.lodolo@mozillaitalia.org:
https://hg.mozilla.org/integration/autoland/rev/2222a3f4ae1b
Fix Fluent migration code for home-page-header r=gandalf
https://hg.mozilla.org/mozilla-central/rev/2222a3f4ae1b
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 61
You need to log in before you can comment on or make changes to this bug.