[orca] Web: Add new message for entering a description list



commit f6424143a73764af4a050c214d8b8b780310b5eb
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Fri Jun 17 16:39:37 2022 +0200

    Web: Add new message for entering a description list
    
    * Call the list a "description list" (rather than just "list")
    * Announce the count of "terms" (rather than "items")
    
    See issue #248

 src/orca/messages.py                     | 7 +++++++
 src/orca/scripts/web/speech_generator.py | 5 ++++-
 2 files changed, 11 insertions(+), 1 deletion(-)
---
diff --git a/src/orca/messages.py b/src/orca/messages.py
index 36849956b..545f3ede7 100644
--- a/src/orca/messages.py
+++ b/src/orca/messages.py
@@ -2562,6 +2562,13 @@ def listItemCount(count):
     # Translators: This message describes a bulleted or numbered list.
     return ngettext("List with %d item", "List with %d items", count) % count
 
+def descriptionListTermCount(count):
+    # Translators: This message describes a description list.
+    # See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dl
+    # Note that the "term" here corresponds to the "dt" element
+    return ngettext("Description list with %d term",
+                    "Description list with %d terms", count) % count
+
 def mathTableSize(nRows, nColumns):
     # Translators: this represents the number of rows in a mathematical table.
     # See http://www.w3.org/TR/MathML3/chapter3.html#presm.mtable
diff --git a/src/orca/scripts/web/speech_generator.py b/src/orca/scripts/web/speech_generator.py
index 77ad3b6d0..3c4e345ff 100644
--- a/src/orca/scripts/web/speech_generator.py
+++ b/src/orca/scripts/web/speech_generator.py
@@ -465,7 +465,10 @@ class SpeechGenerator(speech_generator.SpeechGenerator):
         if not setsize:
             return []
 
-        result = [messages.listItemCount(setsize)]
+        if self._script.utilities.isDescriptionList(obj):
+            result = [messages.descriptionListTermCount(setsize)]
+        else:
+            result = [messages.listItemCount(setsize)]
         result.extend(self.voice(speech_generator.SYSTEM, obj=obj, **args))
         return result
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]