Bug 953853 - [Accessibility] Add accessible text for the status icons and other purely graphical info, r=clokep.

This commit is contained in:
Benedikt Pfeifer 2012-05-24 19:29:19 +02:00
Родитель 52f5f242a4
Коммит 841b4377d0
2 изменённых файлов: 57 добавлений и 0 удалений

Просмотреть файл

@ -146,6 +146,30 @@
</setter>
</property>
<property name="bundle">
<getter>
<![CDATA[
if (!this._bundle) {
this._bundle =
Services.strings.createBundle("chrome://instantbird/locale/instantbird.properties");
}
return this._bundle;
]]>
</getter>
</property>
<!-- Textual representation of the contact and its status for accessibility
tools -->
<property name="label" readonly="true">
<getter>
<![CDATA[
let params = [this.contact.displayName, this.getAttribute("statusText")];
return this.bundle.formatStringFromName("contact.collapsed", params,
params.length);
]]>
</getter>
</property>
<!-- nsIObserver implementation -->
<method name="observe">
<parameter name="aSubject"/>
@ -543,6 +567,26 @@
</xul:vbox>
</content>
<implementation>
<!-- Textual representation of the contact and its status (and grouped
buddies if applicable) for accessibility tools -->
<property name="label" readonly="true">
<getter>
<![CDATA[
let propertyName = "contact.collapsed";
let params = [this.contact.displayName, this.getAttribute("statusText")];
let buddies = this.contact.getBuddies().map(function(b) b.displayName);
// Add the list of buddies only if there's more than one to avoid un-
// necessary duplication of the same name.
if (buddies.length > 1) {
propertyName = "contact.expanded";
params.push(buddies.join(this.bundle.GetStringFromName("contact.buddySeparator")));
}
return this.bundle.formatStringFromName(propertyName, params, params.length);
]]>
</getter>
</property>
<method name="open">
<body>
<![CDATA[

Просмотреть файл

@ -56,6 +56,19 @@ group.hidePrompt.title=Hide %S?
# The translation for 'Other Contacts' should match group.otherContacts.name
group.hidePrompt.message=The tag '%S' will no longer be visible. Use the 'Visible Tags…' context menu item to show it again.\n\nContacts that have no visible tag will be displayed in the 'Other Contacts' special group at the bottom of the list.
#LOCALIZATION NOTE
# The following strings are used as textual representation of contacts, that
# screenreaders can read out loud for visually impaired users.
# %1$S is the displayname of the contact
# %2$S is the status text of this contact
# %3$S is a list of the contact's buddies, joined by contact.buddyListSeparator
# Example for the compact/collapsed state of a contact: "John Doe (I'm away)"
contact.collapsed=%1$S (%2$S)
# Example for the expanded state: "John Doe (I'm away): John Doe, JohnDoe@gmail.com"
contact.expanded=%1$S (%2$S): %3$S
# The trailing space here is intentional.
contact.buddySeparator=,
#LOCALIZATION NOTE
# the & symbol indicates the position of the character that should be
# used as the accesskey for this button.