orca r4523 - in trunk: . src/orca/scripts/toolkits/Gecko test/keystrokes/firefox



Author: wwalker
Date: Wed Feb 11 19:56:46 2009
New Revision: 4523
URL: http://svn.gnome.org/viewvc/orca?rev=4523&view=rev

Log:
Fix for bug #561660 - For example with firefox 3.0, heading levels incorrect sayed for hungarian grammatical


Modified:
   trunk/ChangeLog
   trunk/src/orca/scripts/toolkits/Gecko/speech_generator.py
   trunk/test/keystrokes/firefox/page_summary.py

Modified: trunk/src/orca/scripts/toolkits/Gecko/speech_generator.py
==============================================================================
--- trunk/src/orca/scripts/toolkits/Gecko/speech_generator.py	(original)
+++ trunk/src/orca/scripts/toolkits/Gecko/speech_generator.py	Wed Feb 11 19:56:46 2009
@@ -79,14 +79,32 @@
 
         utterances = []
         if role or not obj.getRole() in doNotSpeak:
-            utterances.append(rolenames.getSpeechForRoleName(obj, role))
             if obj.getRole() == pyatspi.ROLE_HEADING:
                 level = self._script.getHeadingLevel(obj)
                 if level:
-                    # Translators: this is in reference to a heading level
-                    # in HTML (e.g., For <h3>, the level is 3).
+                    # Translators: the %d is in reference to a heading
+                    # level in HTML (e.g., For <h3>, the level is 3)
+                    # and the %s is in reference to a previously
+                    # translated rolename for the heading.  If you
+                    # change the order of the %s and %d in the string
+                    # (as needed for Hungarian, for example), Orca will
+                    # detect it and do the right thing.
                     #
-                    utterances.append(_("level %d") % level)
+                    headingString = _("%s level %d")
+                    if headingString.index("%s") < headingString.index("%d"):
+                        utterances.append(
+                            headingString \
+                            % (rolenames.getSpeechForRoleName(obj, role),
+                               level))
+                    else:
+                        utterances.append(
+                            headingString \
+                            % (level,
+                               rolenames.getSpeechForRoleName(obj, role)))
+                else:
+                    utterances.append(rolenames.getSpeechForRoleName(obj, role))
+            else:
+                utterances.append(rolenames.getSpeechForRoleName(obj, role))
 
         return utterances
 

Modified: trunk/test/keystrokes/firefox/page_summary.py
==============================================================================
--- trunk/test/keystrokes/firefox/page_summary.py	(original)
+++ trunk/test/keystrokes/firefox/page_summary.py	Wed Feb 11 19:56:46 2009
@@ -51,7 +51,7 @@
      "BRAILLE LINE:  'This is a Heading 6. h6'",
      "     VISIBLE:  'This is a Heading 6. h6', cursor=1",
      "SPEECH OUTPUT: ''",
-     "SPEECH OUTPUT: 'heading'",
+     "SPEECH OUTPUT: 'heading level 6'",
      "SPEECH OUTPUT: 'This is a Heading 6.'",
      "SPEECH OUTPUT: ''",
      "SPEECH OUTPUT: '14 headings'",



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