Migrate some error/warning strings from dom.properties to Fluent
Categories
(Core :: DOM: UI Events & Focus Handling, task)
Tracking
()
People
(Reporter: eemeli, Unassigned)
References
(Blocks 1 open bug)
Details
According to the arewefluentyet.com M2 data, at least the WinConflict2
string is formatted six times during startup from here.
I wasn't able to figure out why it's being formatted, though.
While the properties-to-ftl tool should make migrating the strings themselves relatively easy, it isn't able to automatically update the C++ call sites. For that, there's at least an example that may be followed.
Comment 1•3 years ago
|
||
I guess *Conflict2 gets formatted for all the conflicting key + modifier combinations.
https://bugzilla.mozilla.org/show_bug.cgi?id=240627 has some background.
And https://bugzilla.mozilla.org/show_bug.cgi?id=1297993 tweaked that a bit.
Is there some example code already in Gecko (not only test) to show how to use Fluent in this case?
Like where would one move the string from the properties file?
I guess I should read https://github.com/mozilla/properties-to-ftl/ :)
(I wonder if we can change nsContentUtils::ReportToConsole to handle this in most cases)
Reporter | ||
Comment 2•3 years ago
|
||
(In reply to Olli Pettay [:smaug] from comment #1)
I guess *Conflict2 gets formatted for all the conflicting key + modifier combinations.
https://bugzilla.mozilla.org/show_bug.cgi?id=240627 has some background.
And https://bugzilla.mozilla.org/show_bug.cgi?id=1297993 tweaked that a bit.
Okay, that does explain things. Is the console to which these warnings are logged available somewhere?
Is there some example code already in Gecko (not only test) to show how to use Fluent in this case?
There's at least this: https://phabricator.services.mozilla.com/D131594
Like where would one move the string from the properties file?
I guess I should read https://github.com/mozilla/properties-to-ftl/ :)
Yeah, the README there at least tries to answer most of the questions. If there's something unclear or missing, it'd be great to hear about it so we can improve the docs.
(I wonder if we can change nsContentUtils::ReportToConsole to handle this in most cases)
Another bug that I just filed also includes some formatting via nsContentUtils::ReportToConsole. Making that function be able to also handle FTL files might help quite a bit. It's not a panacea, though, as it's not the only route for formatting these strings.
Description
•