Closed Bug 1517919 Opened 6 years ago Closed 6 years ago

Fluent content is not localized on Fennec

Categories

(Firefox Build System :: Android Studio and Gradle Integration, defect)

defect
Not set
normal

Tracking

(firefox66 fixed)

RESOLVED FIXED
mozilla66
Tracking Status
firefox66 --- fixed

People

(Reporter: flod, Assigned: Pike)

Details

Attachments

(1 file)

Spin-off from bug 1516799. Both about:support and about:about are not localized on Fennec, and fall back to English. Filed in Build, because I assume we're doing something wrong at that level. en-US files: resource:///localization/en-US/toolkit/en-US/toolkit has several folders, the /about folder has about 10 files. resource:///localization/it/toolkit/ has FTL files in the root.

Is brand.ftl for Fennec localized? If not, we're likely hitting the scenario where a missing file makes us reject the bundle.

(In reply to Zibi Braniecki [:gandalf][:zibi] from comment #1)

Is brand.ftl for Fennec localized? If not, we're likely hitting the scenario where a missing file makes us reject the bundle.I

I don't really know, but it shouldn't be: Fennec branding is never localized. See, e.g.,

https://searchfox.org/mozilla-central/rev/76fe4bb385348d3f45bbebcf69ba8c7283dfcec7/mobile/android/branding/official/locales/jar.mn#12

I remember being surprised by this, i.e.,

https://searchfox.org/mozilla-central/rev/76fe4bb385348d3f45bbebcf69ba8c7283dfcec7/python/mozbuild/mozbuild/action/generate_strings_xml.py#26

You're right. I confirmed that the issue is not related to brand.ftl.

I opened today's Fennec, connected to it via WebIDE, selected Italian and Polish as my languages and loaded L10nRegistry to look at its cache:

const { L10nRegistry } = ChromeUtils.import("resource://gre/modules/L10nRegistry.jsm", {});
console.dir(L10nRegistry.sources.get("toolkit").cache)

result:

"resource://gre/localization/en-US/branding/brand.ftl": Map { "-brand-short-name" → "Nightly", "-brand-full-name" → "Mozilla Nightly" }
​"resource://gre/localization/en-US/toolkit/about/aboutSupport.ftl": Map(203) { "page-title" → "Troubleshooting Information", "crashes-title" → "Crash Reports", "crashes-id" → "Report ID", … }
​"resource://gre/localization/it/branding/brand.ftl": Map { "-brand-short-name" → "Nightly", "-brand-full-name" → "Mozilla Nightly" }
​"resource://gre/localization/it/toolkit/about/aboutSupport.ftl": false
​"resource://gre/localization/pl/branding/brand.ftl": Map { "-brand-short-name" → "Nightly", "-brand-full-name" → "Mozilla Nightly" }
​"resource://gre/localization/pl/toolkit/about/aboutSupport.ftl": false

Then, I loaded resource://gre/localization/it/toolkit/ into Fennec and it shows two files: aboutAbout.ftl and aboutSupport.ftl.

While resource://gre/localization/en-US/toolkit/ shows four directories: 'about'/'main-window'/'preferences'/'updates', and the 'about' directory has 10 files in it including aboutAbout.ftl and aboutSupport.ftl.

This tells me that we're doing a bad job with packaging ftl resources into Fennec and it should affect other pages which use FTL as well :(

This is the chrome-% target doing things wrong, because %toolkit/about/about*.ftl isn't the same as %toolkit/**/*.ftl, the about directory get's dropped.

Assignee: nobody → l10n

PS: There are two ways to fix this:

toolkit/about (%toolkit/about/*About.ftl)

or

toolkit (%toolkit/about*/*About.ftl)

I've went for the first, because the latter looks even weirder, and it would also involve changing the path at least in l10n.toml, just to be consistent. I found that ugly.

So I went for the slightly confusing but correct "if you're using wildcards in toolkit and copy out of directories in mobile, copy to a directory" story.

I inspected the omni.ja in the apk from try, and that looks promising:

...
524 01-01-2010 00:00 localization/en-CA/branding/brand.ftl
524 01-01-2010 00:00 localization/en-GB/branding/brand.ftl
524 01-01-2010 00:00 localization/en-US/branding/brand.ftl
524 01-01-2010 00:00 localization/en-ZA/branding/brand.ftl
524 01-01-2010 00:00 localization/eo/branding/brand.ftl
524 01-01-2010 00:00 localization/es-AR/branding/brand.ftl
...
460 01-01-2010 00:00 localization/en-CA/toolkit/about/aboutAbout.ftl
460 01-01-2010 00:00 localization/en-GB/toolkit/about/aboutAbout.ftl
460 01-01-2010 00:00 localization/en-US/toolkit/about/aboutAbout.ftl
448 01-01-2010 00:00 localization/en-ZA/toolkit/about/aboutAbout.ftl
447 01-01-2010 00:00 localization/eo/toolkit/about/aboutAbout.ftl
499 01-01-2010 00:00 localization/es-AR/toolkit/about/aboutAbout.ftl
506 01-01-2010 00:00 localization/es-CL/toolkit/about/aboutAbout.ftl
496 01-01-2010 00:00 localization/es-ES/toolkit/about/aboutAbout.ftl
...
15735 01-01-2010 00:00 localization/el/toolkit/about/aboutSupport.ftl
10607 01-01-2010 00:00 localization/en-CA/toolkit/about/aboutSupport.ftl
10606 01-01-2010 00:00 localization/en-GB/toolkit/about/aboutSupport.ftl
10622 01-01-2010 00:00 localization/en-US/toolkit/about/aboutSupport.ftl
6545 01-01-2010 00:00 localization/en-ZA/toolkit/about/aboutSupport.ftl
10976 01-01-2010 00:00 localization/eo/toolkit/about/aboutSupport.ftl
11614 01-01-2010 00:00 localization/es-AR/toolkit/about/aboutSupport.ftl
11693 01-01-2010 00:00 localization/es-CL/toolkit/about/aboutSupport.ftl

Talking about brand.ftl: are we going to fail localizing about:support since we can't localize that file on Fennec?

No. It's autopopulated from en-us and in result it's present in the build

Attachment #9034859 - Attachment description: Bug 1517919, put Fluent files into right subdirectory for chrome-%, r=#firefox-build-system-reviewers → Bug 1517919, put Fluent files into right subdirectory for chrome-%, r=nalexander
Pushed by axel@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/a9422d15a9f5 put Fluent files into right subdirectory for chrome-%, r=nalexander
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 66
Product: Firefox for Android → Firefox Build System
Target Milestone: Firefox 66 → mozilla66
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: