Closed Bug 1438608 Opened 7 years ago Closed 7 years ago

Missing strings are overreported ("L10nError: Unknown message")

Categories

(Core :: Internationalization, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
mozilla60
Tracking Status
firefox60 --- fixed

People

(Reporter: zbraniecki, Assigned: zbraniecki)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Fluent introduces a fallback mechanism to handle a scenario when the string is missing or unresolvable in one locale, and has to fallback on its fallback locale (currently always en-US, but in the future we may have a nicer fallback chain). The mechanism works great, except that it generates a lot of noise in the console. This is particularly noticable in the period between patch landing and migration because all non-en-US builds of such nightly will have missing strings. Here's how it looks for `pl`: ``` L10nError: Unknown message: category-general Ślad stosu: L10nError@resource://gre/modules/Localization.jsm:106:5 messageFromContext@resource://gre/modules/Localization.jsm:359:17 keysFromContext/<@resource://gre/modules/Localization.jsm:426:25 keysFromContext@resource://gre/modules/Localization.jsm:420:3 formatWithFallback@resource://gre/modules/Localization.jsm:172:22 async*formatMessages@resource://gre/modules/Localization.jsm:204:12 translateElements@resource://gre/modules/DOMLocalization.jsm:572:32 async*translateRoots/<@resource://gre/modules/DOMLocalization.jsm:470:25 translateRoots@resource://gre/modules/DOMLocalization.jsm:470:7 onLanguageChange@resource://gre/modules/DOMLocalization.jsm:352:5 observe@resource://gre/modules/Localization.jsm:284:9 registerSource@resource://gre/modules/L10nRegistry.jsm:112:5 startup@resource://gre/modules/Extension.jsm:1829:7 async*startup@resource://gre/modules/Extension.jsm:1068:12 callBootstrapMethod@resource://gre/modules/addons/XPIProvider.jsm:4415:20 startInstall/<@resource://gre/modules/addons/XPIInstall.jsm:1855:13 async*startInstall@resource://gre/modules/addons/XPIInstall.jsm:1749:6 install@resource://gre/modules/addons/XPIInstall.jsm:1421:7 install@resource://gre/modules/addons/XPIInstall.jsm:2163:7 checkForBlockers@resource://gre/modules/addons/XPIInstall.jsm:1707:5 install@resource://gre/modules/addons/XPIInstall.jsm:1418:7 install@resource://gre/modules/addons/XPIInstall.jsm:2163:7 checkPrompt/<@resource://gre/modules/addons/XPIInstall.jsm:1682:7 async*checkPrompt@resource://gre/modules/addons/XPIInstall.jsm:1662:6 install@resource://gre/modules/addons/XPIInstall.jsm:1415:7 install@resource://gre/modules/addons/XPIInstall.jsm:2163:7 downloadCompleted/<@resource://gre/modules/addons/XPIInstall.jsm:2479:9 makeSafe/<@resource://gre/modules/addons/XPIProvider.jsm -> resource://gre/modules/addons/XPIProviderUtils.js:95:17 getRepositoryAddon@resource://gre/modules/addons/XPIProvider.jsm -> resource://gre/modules/addons/XPIProviderUtils.js:76:5 getAddon/<@resource://gre/modules/addons/XPIProvider.jsm -> resource://gre/modules/addons/XPIProviderUtils.js:722:9 promise callback*getAddon@resource://gre/modules/addons/XPIProvider.jsm -> resource://gre/modules/addons/XPIProviderUtils.js:720:12 getVisibleAddonForID@resource://gre/modules/addons/XPIProvider.jsm -> resource://gre/modules/addons/XPIProviderUtils.js:769:5 downloadCompleted@resource://gre/modules/addons/XPIInstall.jsm:2456:5 onStopRequest/<@resource://gre/modules/addons/XPIInstall.jsm:2402:13 promise callback*onStopRequest@resource://gre/modules/addons/XPIInstall.jsm:2400:9 ``` and so on 19 times (number of messages added to en-US and not yet migrated in locales). We should do a better job at presenting this as a single warning/message, rather than 19 errors.
Blocks: 1365426
Priority: -- → P3
Personal take: * We should reduce the noise, as you wrote. The UI is doing the right thing (falling back), one message as a warning would be enough. * I don't think we should show this kind of warnings outside of Nightly (maybe Dev Edition). I don't see value added to the user by telling them about unknown l10n messages.
A patch I just landed in fluent-dom fixes it - https://github.com/projectfluent/fluent.js/commit/3eb3709451c45df8b9a0a5505b8b5cdf02cefca1 While majority of the work to align the code between Gecko and fluent.js repo will go to bug 1434434, I believe it's worth downstreaming this single change into 60 since it vastly improves experience of working with the code.
Assignee: nobody → gandalf
Status: NEW → ASSIGNED
Comment on attachment 8956374 [details] Bug 1438608 - Improve error reporting of Fluent missing strings. https://reviewboard.mozilla.org/r/225240/#review231220
Attachment #8956374 - Flags: review?(stas) → review+
Pushed by zbraniecki@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/8381ed38af10 Improve error reporting of Fluent missing strings. r=stas
Blocks: 1394885
No longer blocks: 1365426
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla60
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: