Closed
Bug 751428
Opened 13 years ago
Closed 13 years ago
[AccessFu] Remove spaces and catch exceptions when localizing role names
Categories
(Core :: Disability Access APIs, defect)
Tracking
()
RESOLVED
FIXED
mozilla15
People
(Reporter: eeejay, Assigned: eeejay)
Details
Attachments
(1 file, 1 obsolete file)
2.68 KB,
patch
|
davidb
:
review+
|
Details | Diff | Splinter Review |
Some role names have spaces, we need to remove the spaces to make it a legal token for localization. Also, use an empty string when the role name is not localizable instead of throwing an exception.
Assignee | ||
Comment 1•13 years ago
|
||
Assignee | ||
Comment 2•13 years ago
|
||
Comment on attachment 620532 [details] [diff] [review]
Remove spaces and catch exceptions when localizing role names.
Oops
Attachment #620532 -
Attachment is obsolete: true
Attachment #620532 -
Flags: review?
Assignee | ||
Comment 3•13 years ago
|
||
Made a special new method for this, instead of doing the try/catch dance everywhere.
Attachment #620536 -
Flags: review?(dbolter)
Updated•13 years ago
|
Attachment #620532 -
Flags: review?
Comment 4•13 years ago
|
||
Comment on attachment 620536 [details] [diff] [review]
Remove spaces and catch exceptions when localizing role names.
Review of attachment 620536 [details] [diff] [review]:
-----------------------------------------------------------------
r=me. Thanks for the explanation over on bug 751435 and IRC - that you need to trim whitespace so that you can use these as the key for l10n lookups.
::: accessible/src/jsat/UtteranceGenerator.jsm
@@ +220,5 @@
> return [desc, name];
> }
> + },
> +
> + _getLocalizedRole: function(aRoleStr) {
Are you using this convention for denoting mock encapsulation?
Attachment #620536 -
Flags: review?(dbolter) → review+
Comment 5•13 years ago
|
||
(I mean the underscore prefix)
Assignee | ||
Comment 6•13 years ago
|
||
(In reply to David Bolter [:davidb] from comment #4)
> Comment on attachment 620536 [details] [diff] [review]
> Remove spaces and catch exceptions when localizing role names.
>
> Review of attachment 620536 [details] [diff] [review]:
> -----------------------------------------------------------------
>
> r=me. Thanks for the explanation over on bug 751435 and IRC - that you need
> to trim whitespace so that you can use these as the key for l10n lookups.
Thanks!
>
> ::: accessible/src/jsat/UtteranceGenerator.jsm
> @@ +220,5 @@
> > return [desc, name];
> > }
> > + },
> > +
> > + _getLocalizedRole: function(aRoleStr) {
>
> Are you using this convention for denoting mock encapsulation?
No, I am using it for private methods on an object that otherwise has public methods. Something from Python, although I have seen it in other mozilla js. Need to be more consistent with it.
Comment 7•13 years ago
|
||
(In reply to Eitan Isaacson [:eeejay] from comment #6)
> (In reply to David Bolter [:davidb] from comment #4)
> > > + _getLocalizedRole: function(aRoleStr) {
> >
> > Are you using this convention for denoting mock encapsulation?
>
> No, I am using it for private methods on an object that otherwise has public
> methods. Something from Python, although I have seen it in other mozilla js.
> Need to be more consistent with it.
Heh. Encapsulation has two meanings (who knew?) but I meant "a language mechanism for restricting access to some of the object's components." (wikipedia) Anyways, all good. As long as you plan on consistency using _ for mock privacy it is fine with me. It isn't worth doing the Crockford tricks for actual privacy IMO.
Comment 8•13 years ago
|
||
Comment on attachment 620536 [details] [diff] [review]
Remove spaces and catch exceptions when localizing role names.
Review of attachment 620536 [details] [diff] [review]:
-----------------------------------------------------------------
::: accessible/src/jsat/UtteranceGenerator.jsm
@@ +220,5 @@
> return [desc, name];
> }
> + },
> +
> + _getLocalizedRole: function(aRoleStr) {
pls don't use unnamed functions
@@ +222,5 @@
> + },
> +
> + _getLocalizedRole: function(aRoleStr) {
> + try {
> + return gStringBundle.GetStringFromName(aRoleStr.replace(' ', ''));
just curious if properties file is updated to this logic already
Assignee | ||
Comment 9•13 years ago
|
||
Assignee: nobody → eitan
OS: Linux → Android
Hardware: x86_64 → ARM
Target Milestone: --- → mozilla15
Comment 10•13 years ago
|
||
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•