GNOME Bugzilla – Bug 561660
For example with firefox 3.0, heading levels incorrect sayed for hungarian grammatical
Last modified: 2009-03-10 14:25:35 UTC
Please describe the problem: Dear Developers! When I navigating headings with firefox 3.0, the heading levels incorrect sayed for Orca with hungarian language. This is not a translation problem because Orca get heading number with %d parameter, only little fix solve this problem with future version of Orca. Now when press h key on webpage with have headings, Orca says: Heading text heading level 1 (get heading number for %d parameter if I remember correct). My suggestion: Only 6 heading levels possible any webpage. Possible make 6 strings for this, replace the old method: heading level 1 heading level 2 heading level 3 heading level 4 heading level 5 heading level 6 Any translator translate this string any form, for example in hungarian: Heading level 1 - első címsor szint Heading level 2 - második címsor szint Heading level 3 - harmadik címsor szint Heading level 4 - negyedik címsor szint Heading level 5 - ötödik címsor szint. Heading level 6 - hatodik címsor szint. Another suggestion for example: Possible replace this: Heading level text heading level 1 with: Heading level 1 heading level text, for example: Orca now says: What is Orca heading level 1 Replace: heading level 1 What is Orca? Similar with Orca structural navigation keybindings command messages: Goes to next heading level 1 Goes to next heading level 2 Goes to next heading level 3 Goes to next heading level 4 etc (get parameters for heading level number at %d) now. Goes to previous heading level 1 Goes to previous heading level 2 etc (get parameter for %d now). Thanks, and if I help solve this problem, i would like help you. Attila Steps to reproduce: 1. 2. 3. Actual results: Expected results: Does this happen every time? yes Other information:
So, what I think I understand the problem to be is that Hungarian wants the heading number before the role whereas English wants the role before the number. Hmm...definitely a difficult problem. For the heading level issue, I believe the Orca code that is doing this is as follows: 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). # utterances.append(_("level %d") % level) I wonder if the code might be adjusted somehow to end up with something that looks like the following pseudocode: headingString = _("%s level %d") if "%s" is before "%d" in heading string: utterances.append(headingString % (rolenames.getSpeechForRoleName(obj, role), level)) else: utterances.append(headingString % (level, rolenames.getSpeechForRoleName(obj, role))) The Hungarian translation for "%s level %d" could then return "első címsor szint
Will, how can I make a little patch, fixing this problem? Or what script paste I your code wroted prewious comment? The 1. heading level and heading text story is: The hungarian localized Jaws version says this form with html headings, but it is not a big problem if not realize with Orca. Only enough if work the heading level number correct translation, not a number parameter (heading level 1 replaces first heading level string). I not home for this weekend, if need testing any patch, only do testing with next week. Attila
Created attachment 125790 [details] [review] Untested, unlinted, example patch Here's an example of something that *might* work. What you do is offer a different translation for "%s level %d" that reverses the order of %d and %s. I'm not sure if this is quite what you're asking for, so let me know. :-)
Uh oh, I tryed the patch, the result: The heading levels does'nt spokening, and when I tryed read html document with numpad+ key and if positioning cursor with heading level, the sayall command stopping. Attila
(In reply to comment #4) > Uh oh, I tryed the patch, the result: > The heading levels does'nt spokening, and when I tryed read html document with > numpad+ key and if positioning cursor with heading level, the sayall command > stopping. Bummer. There's probably some silly syntax error in the patch. If you turn debugging on and also observe the output in the shell where you start Orca, do you notice any strange stack traces?
I seeing this traceback message when I tryed pressing h key with web browsing. Applyed the attached patch and analyzing the debug.out file. Traceback (most recent call last):
+ Trace 211418
consumed = self.function(script, inputEvent)
self.structuralNavigation.goObject(self, True)
structuralNavigationObject.present(obj, arg)
self._presentObject(obj, characterOffset)
self._script.speakContents(contents)
utterances = self.getUtterancesFromContents(contents, speakRole)
self.speechGenerator.getSpeechForObjectRole(heading))
rolenames.getSpeechForRoleName(obj, role)))
I seeing this traceback message when I trying sayall the document with numpad+ key. Next comment I sending the debug.out file with attachment. Attila
Created attachment 126102 [details] This is the needed debug.out file, reproducing the problem. Because it is too big, I sending zip compressed. Will, I sending the required debug.out file.
D'Oh! Try changing this line: if headingString.index("%s") > headingString.index("%d"): to: if headingString.index("%s") < headingString.index("%d"): It just changes the ">" to "<".
Work! Little suggestions: But little problem is present: Unnecessary heading text spokening with src/orca/rolenames.py file. I doing this translation form: %d heading level %s. For example this text spokened when I navigating headings: 1. heading level my name heading 2. heading level my profile heading. Very big modification doing six translatable variables: 1. =first 2. =second 3. =third. 4. =fourth 5. =fiveth 6. =sixth Another suggestion: When the user navigate with heading the H or h keys, For example with hungarian translation, the %s %d level is correct. But when trying sayall the document with numpad+ key, possible replaceable the order? In this example, the user pressing numpad + key, and the %d level %s was spokening the future. Attila
(In reply to comment #9) > Work! Yeah! > But little problem is present: > Unnecessary heading text spokening with src/orca/rolenames.py file. > I doing this translation form: > %d heading level %s. The word "heading" is going to come from the role name, so it should not be placed in the translated string. > Very big modification doing six translatable variables: > 1. =first > 2. =second > 3. =third. > 4. =fourth > 5. =fiveth > 6. =sixth I'm not sure I understand what you're asking. :-( Are you saying that the translated form should be the ordinal version of a number (first, second, third) instead of the cardinal version (one, two, three)? If so, this might be a bit tougher to pull off. > Another suggestion: > When the user navigate with heading the H or h keys, For example with hungarian > translation, the %s %d level is correct. > But when trying sayall the document with numpad+ key, possible replaceable the > order? > In this example, the user pressing numpad + key, and the %d level %s was > spokening the future. I'm also confused about this. Are you saying that if someone navigates to a heading, then it should be spoken differently in Hungarian than if it were encountered if someone were just having the document read to them? I think this might be something very difficult to pull off.
Yeah, we don't need work ordinal numbers problem (1. =first, 2. =second etc). Espeak 1.40.4 version have an Ordinal feature. If the user writing for example 1. and the next word not beginning capital letter, espeak says correct the ordinal numbers for example with hungarian language. Nicefuly! The read suggestion I try demonstrate with Orca page. When I navigating headings with h or shift+h keys, orca says correct: Configuration/Use heading level 1 Accessible applications heading level 1 But when the numpad plus keys says the document, this combination is not right my openion. Not a big problem, but the optimal result for this situation when the user sayall the document: Heading level 1 download/installation heading level 1 accessible applications. For example Jaws for Windows using this method (the english and international versions), of course localized form. Attila
(In reply to comment #11) > Yeah, we don't need work ordinal numbers problem (1. =first, 2. =second etc). > Espeak 1.40.4 version have an Ordinal feature. If the user writing for example > 1. and the next word not beginning capital letter, espeak says correct the > ordinal numbers for example with hungarian language. Nicefuly! > > The read suggestion I try demonstrate with Orca page. > When I navigating headings with h or shift+h keys, orca says correct: > Configuration/Use heading level 1 > Accessible applications heading level 1 I'm still not sure what new behavior you are asking for. :-( Do you want this behavior when arrowing as well? For example, when you press the down arrow and land on a heading, do you want to hear "Configuration/Use heading level 1"? Or, do you want to hear "Heading level 1 Configuration/Use"? In other words, do you want to put the heading level information at the end of the utterance only if you're pretty sure that you're on a heading? That is, the 'h' key and the 1-6 keys will end up taking you to a new heading. As a result, you know you are on a heading so the heading rolename information is kind of redundant speech. Moving it to the end in this case makes sense. But, when navigating around via other means such arrow keys, tabbing, say all, etc., you might land on a heading and not know it. So, I'm guessing you want the heading information presented first in those cases. Is this the behavior you're looking for?
When I land on a heading with down arrow key, I want hearing english demonstrate because it is simple: "Heading level 1 Configuration/Use" When I say all the document, I want hear: "Heading level 1 Configuration/Use" When I navigating headings (h or Shift+h, 1-6 or Shift+1-6, tab) and if the heading is not special heading link), I want hearing: Configuration/Use Heading level 1" Or if the heading is heading link, I want hear: "Configuration/Use Heading level 1 link" Of course, please variate the %d and %s values because the attached patch is good result, only little modification is need if I know right. Attila
If I were to generalize your request into the following rules, would it be accurate? 1) If you perform some navigation action that purposely takes you to a heading and nowhere else (e.g., the structural navigation commands 'h' and '1'-'6'), you want the heading information spoken last. 2) In all other cases, you want the heading information spoken first. Is that correct?
Yes, it is absolute correct. Except the up arrow navigation or down arrow navigation. When the user using this two keys and the cursor land on a heading, I would like hear following form: Heading level 1 configuration/use. Attila
(In reply to comment #15) > Yes, it is absolute correct. > Except the up arrow navigation or down arrow navigation. > When the user using this two keys and the cursor land on a heading, I would > like hear following form: > Heading level 1 configuration/use. I'm not sure it will be possible to implement what you're asking for, but I'm still confused about what you want. I do think we're getting closer, though. Let me try to make sure we have a mutual understanding by trying to rephrase things. How about this: You want to hear the heading information spoken last ONLY when you press one of these structural navigation keys: h, 1, 2, 3, 4, 5, 6. In all other cases, you want the heading information spoken first. Is that right?
Yes, correct. Attila
I would'nt like open new bug, but I seeing interesting think: When trying navigating heading with the structural navigating commands and press after the navigation one or more left arrow and after this pressing heading structural navigation commands (for example h jump to next heading), Orca jumping the first heading not a next heading. I seeing this problem with www.index.hu/vakbarat webpage. Will, you confirm this another webpages, or this is the webpage problem? This problem present before applying the patch and present after applying. Attila
Hi Atilla, yes, i can confirm the heading bug on that webpage, please open new bug. Thank you
Thanks Jon! I opened this problem new bugreport with: http://bugzilla.gnome.org/show_bug.cgi?id=567984 Jon, please write comment this bugreport if need. Attila
Assigning to me so that it's on my radar.
I'm tempted to break this into two different bugs: 1. Address the Hungarian-specific needs already discussed and (I think) addressed by Attila and Will here. 2. Add a setting by which users could configure where the role information is spoken. After all, this doesn't just apply to headings. If you want heading information spoken first for reading but last for structural navigation, might you want to hear "link" before links when reading a page and after when using U/V? Thoughts?
(In reply to comment #22) > I'm tempted to break this into two different bugs: > > 1. Address the Hungarian-specific needs already discussed and (I think) > addressed by Attila and Will here. > > 2. Add a setting by which users could configure where the role information is > spoken. After all, this doesn't just apply to headings. If you want heading > information spoken first for reading but last for structural navigation, might > you want to hear "link" before links when reading a page and after when using > U/V? > > Thoughts? Breaking it into two bugs sounds good to me. The "how you got here" one (the second one) seems like a very interesting one.
(In reply to comment #23) > Breaking it into two bugs sounds good to me. Cool. Done. I've opened an enhancement (bug #569928) for the latter issue. > The "how you got here" one (the > second one) seems like a very interesting one. I agree. That's why I've assigned it to myself. ;-) If you really want it though, you can snatch it from me. :-) As for this bug, I hope you don't mind Will, but I'm reassigning it back to you. I've been peripherally aware of it, and I did read through everything this afternoon. But since you and Attila seem to have hashed it all out.... :-) Thanks!
Created attachment 128485 [details] [review] Rev 2 This patch is pylinted and regression tested. It introduces a change to the "Where Am I" speech output for headings, though. Instead of just saying something is a heading, orca also outputs the level. For example, instead of saying "heading blah blah", orca will say "heading level 3 blah blah" with this patch. I actually think that's an improvement. Thoughts?
Since this represents a string change, and since String Freeze is this Monday, I'd like to get closure on this. Mike, you OK with the new addition of the heading level to the "Where Am I" command?
Created attachment 128489 [details] [review] Rev 2 with regression test update included Committed to trunk and string change announcement sent.
PS - I confirmed with Mike that the new behavior is OK. Closing.
Will, what happen the translated string? I updating orca with svn, running intltool-update hu command with po directory, right found one fuzzy message. I translated, deleting fuzzy mark. Next, compiling and install Orca. After this, run intltool-update hu command with po directory. Again marking the translated message with fuzzy (already translated fuzzy message and deleted fuzzy mark). Another problem: The sayall command does'nt change the read order, for example: what is orca heading level 1 To heading level 1 what is orca Because this not good now, I have One question: Because now string freeze (if I known right), undo bugfix, and append work this bug with next developing cicle? Or possible solwing the problems? I found this problem with Ubuntu Jaunty. Attila
Where am I works correct my desktop machine, only problem with sayall and this interesting fuzzy problem. Attila
(In reply to comment #29) > Another problem: > The sayall command does'nt change the read order, for example: > what is orca heading level 1 > To heading level 1 what is orca In comment #24, we have turned that into a separate issue to be tracked in bug #569928. My understanding is that there were really two distinct problems: 1) The grammatical structure of the phrase "heading level 1" needed different word ordering for Hungarian. This bug addresses that by making modifications to the string to be translated. It is a very benign change, and I think all we need to do is get your translation file fixed. 2) The position where the phrase "heading level 1" occurs with respect to the actual heading content. That is tracked via bug #569928. Will
Ok, all right. The problem string is: #. 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. #. #: ../src/orca/scripts/toolkits/Gecko/speech_generator.py:93 msgid "%s level %d" msgstr "%d %s" This is relative good, Orca now speaks this when the h keys navigating heading levels: What is orca 1 heading. I not inserting translation with level word (szint for hungarian), because results wrong string (writing english example): What is Orca 1 level heading. The wishes result: What is Orca 1 heading level Possible modify heading rolename with heading level word? I thing it is enough. If this is now impossible, not a big problem. Will, have any ydea why marking this translation message with intltool-update always fuzzy with all combination? Next comment I sending translation file. Attila
Created attachment 128565 [details] This is the hungarian translation file.
When I found a heading level link, Orca now says the new translation: blablabla hivatkozás 1 cínsor The correct wishes, translating english: blablabla 1 heading level link. this problem this bug competence, or bug 569928? Attila
(In reply to comment #32) > The problem string is: > msgid "%s level %d" > msgstr "%d %s" > This is relative good, Orca now speaks this when the h keys navigating heading > levels: > What is orca 1 heading. > I not inserting translation with level word (szint for hungarian), because > results wrong string (writing english example): > What is Orca 1 level heading. > The wishes result: > What is Orca 1 heading level You could make the string "%d %s szint" > Possible modify heading rolename with heading level word? I thing it is enough. I'm not sure what you're asking. :-( Would the above string ("%d %s szint") accomplish this? > Will, have any ydea why marking this translation message with intltool-update > always fuzzy with all combination? I don't know why the intltool-update gives this. I took the file you attached, however, and did this: 1) ran intltool-update hu 2) deleted the string 'fuzzy' from the new hu.po that resulted 3) reran intltool-update hu At step #3, no fuzzy's seemed to be present.
(In reply to comment #34) > When I found a heading level link, Orca now says the new translation: > blablabla hivatkozás 1 cínsor What is the translated form of this in English? > The correct wishes, translating english: > blablabla 1 heading level link. > > this problem this bug competence, or bug 569928? Does this occur before the change for this bug, or does it happen only after the change for this bug?
Will the following problem (using babilon translation help): If I jumping to a heading reference, and use the current bugfix, Orca says of the next : blablabla reference heading the correct: blablabla 1 címsorszint reference. So that's all right? Címsorszint means in english: level. I will be looking previous Orca version the original method. Attila
Will, this problem is present previous version, now not need fix because very big work. Possible fix with next cicle? %d %s szint works, thanks. Attila
(In reply to comment #38) > Will, this problem is present previous version, now not need fix because very > big work. Possible fix with next cicle? > %d %s szint works, thanks. Excellent. Glad "%d %s szint" works. For the "this problem is present previous version" portion, please open a new bug that clearly describes what the problem is (unless it is the same thing as bug #569928). I'm still not clear on what is currently being presented and what you expect to be presented.
I think this part of bug 569928 solving my problem: "Independent of the method of navigation (and the aforementioned bug), users on the Orca list have requested that certain roles (e.g. link) be spoken before the link rather than after." Attila