Closed
Bug 1313196
Opened 8 years ago
Closed 8 years ago
Add L10N support for the new Debugger
Categories
(DevTools :: Debugger, defect, P1)
DevTools
Debugger
Tracking
(firefox52 fixed)
RESOLVED
FIXED
Firefox 52
Tracking | Status | |
---|---|---|
firefox52 | --- | fixed |
People
(Reporter: jlast, Assigned: jlast)
References
Details
Attachments
(1 file, 1 obsolete file)
5.57 KB,
patch
|
Details | Diff | Splinter Review |
No description provided.
Assignee | ||
Updated•8 years ago
|
Assignee | ||
Comment 1•8 years ago
|
||
Attachment #8805179 -
Flags: review?(jlong)
Assignee | ||
Comment 2•8 years ago
|
||
devtools/client/debugger/new/test/mochitest/browser_dbg-scopes.js
Comment 3•8 years ago
|
||
Comment on attachment 8805179 [details] [diff] [review] l10n2.patch Review of attachment 8805179 [details] [diff] [review]: ----------------------------------------------------------------- Awesome! A few nits, but will go ahead and r+. ::: devtools/client/debugger/new/panel.js @@ +11,4 @@ > > function DebuggerPanel(iframeWindow, toolbox) { > this.panelWin = iframeWindow; > + this.panelWin.L10N = L10N; Are we 100% sure that we don't try to use the L10N APIs until the app is bootstrapped? Just making sure. I think that's right, but wanted to point out that the iframe could have already loaded by this point and JS executed. Just need to make sure the JS that could be executed by this point doesn't use L10N. If it's only our UI, we don't render that until we call `bootstrap`, so I think it should be OK. ::: devtools/client/locales/en-US/debugger.properties @@ +203,5 @@ > + > +# LOCALIZATION NOTE (sources.search): Sources left sidebar prompt > +# e.g. Cmd+P to search. On a mac, we use the command unicode character. > +# On windows, it's ctrl. > +sources.search=%S+P to search Not sure we want to encode the key in here. Could we just do `%S to search` instead? Then we can embed the right keycode elsewhere and it'll be separate. (updating the key shouldn't require re-localization) @@ +212,5 @@ > + > +# LOCALIZATION NOTE (welcome.search): The center pane welcome panel's > +# search prompt. e.g. cmd+p to search for files. On windows, it's ctrl, on > +# a mac we use the unicode character. > +welcome.search=%S+P to search for files ditto
Attachment #8805179 -
Flags: review?(jlong) → review+
Assignee | ||
Comment 4•8 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=1b22146164cf1e1b4c5e7b65c757ce60b54bbdba
Assignee | ||
Comment 5•8 years ago
|
||
> Are we 100% sure that we don't try to use the L10N APIs until the app is bootstrapped?
I believe this is a good assumption for now. We might need to change this if an edge case emerges.
Good call on the search command
Assignee | ||
Comment 6•8 years ago
|
||
Attachment #8805179 -
Attachment is obsolete: true
Pushed by jlong@mozilla.com: https://hg.mozilla.org/integration/fx-team/rev/182f24158aad Add L10N support for the new Debugger. r=jlongster
Pushed by archaeopteryx@coole-files.de: https://hg.mozilla.org/integration/fx-team/rev/a89bd4876d4d Add L10N support for the new Debugger: use ellipsis instead of three full stops. r=maketesthappy
Comment 9•8 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/182f24158aad https://hg.mozilla.org/mozilla-central/rev/a89bd4876d4d
Status: NEW → RESOLVED
Closed: 8 years ago
status-firefox52:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 52
Comment 10•8 years ago
|
||
debugger.properties had about 90 strings before these landings. Are the old strings still used somehow?
Comment 11•8 years ago
|
||
I should have written the whole comment before sending, sorry for the double email. editor.searchResults = %d of %d results Do we have plural support? It's also the first time I see %d used in a string. Can the order be safely swapped?
Flags: needinfo?(jlaster)
Comment 12•8 years ago
|
||
More notes after a quick test: * There are hard-coded strings: "Loading..." when clicking a file, "No Breakpoints" in the sidebar. * Several tooltips in the sidebar show %S, and there are hard-coded strings ("Disable breakpoints"). Are there follow-up discussions?
Assignee | ||
Comment 13•8 years ago
|
||
Hi Francesco, thanks for the comments. > debugger.properties had about 90 strings before these landings They're still used in the old debugger > editor.searchResults = %d of %d results I don't think they can be swapped. An example of this is "1 of 5 results", we don't show "1 or 1 results". > There are hard-coded strings Thanks will fix here https://github.com/devtools-html/debugger.html/issues/1143
Flags: needinfo?(jlaster)
Comment 14•8 years ago
|
||
(In reply to Jason Laster [:jlast] from comment #13) > > editor.searchResults = %d of %d results > > I don't think they can be swapped. An example of this is "1 of 5 results", > we don't show "1 or 1 results". Let me rephrase the question: is it possible for a locale to invert them? Because they might just need to. In Mozilla's .properties files you would have "%S of %S results", and you could implicitly switch to "Total results %2$S, showing number %2$S" (made up example, but just to explain the logic).
Assignee | ||
Comment 15•8 years ago
|
||
Hmm, I can switch to %S. I'm not sure what this logic is: Total results %2$S, showing number %2$S" Are there docs for this?
Comment 16•8 years ago
|
||
I don't know how you parse strings at the moment, but that's the standard with stringbundles https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIStringBundle https://dxr.mozilla.org/mozilla-central/source/toolkit/content/widgets/stringbundle.xml#31
Comment 17•8 years ago
|
||
I dug into this a bit a while ago, there's sprintf.js in the source, the readme at https://github.com/juliandescottes/sprintf.js has the supported syntax. Julian forked that to explicitly support capital S as formatter to be more inline with what we do in the platform. And yes, they're supporting positioned params, too.
Updated•6 years ago
|
Product: Firefox → DevTools
You need to log in
before you can comment on or make changes to this bug.
Description
•