After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 561660 - For example with firefox 3.0, heading levels incorrect sayed for hungarian grammatical
For example with firefox 3.0, heading levels incorrect sayed for hungarian gr...
Status: RESOLVED FIXED
Product: orca
Classification: Applications
Component: speech
2.25.x
Other All
: Normal trivial
: 2.26.0
Assigned To: Willie Walker
Orca Maintainers
Depends on:
Blocks: 404403
 
 
Reported: 2008-11-20 11:33 UTC by Hammer Attila
Modified: 2009-03-10 14:25 UTC
See Also:
GNOME target: ---
GNOME version: 2.23/2.24


Attachments
Untested, unlinted, example patch (2.04 KB, patch)
2009-01-05 16:03 UTC, Willie Walker
needs-work Details | Review
This is the needed debug.out file, reproducing the problem. Because it is too big, I sending zip compressed. (158.36 KB, application/octet-stream)
2009-01-09 12:25 UTC, Hammer Attila
  Details
Rev 2 (2.04 KB, patch)
2009-02-11 18:21 UTC, Willie Walker
none Details | Review
Rev 2 with regression test update included (2.60 KB, patch)
2009-02-11 20:01 UTC, Willie Walker
committed Details | Review
This is the hungarian translation file. (282.56 KB, text/plain)
2009-02-12 14:32 UTC, Hammer Attila
  Details

Description Hammer Attila 2008-11-20 11:33:21 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:
Comment 1 Willie Walker 2008-11-20 17:45:27 UTC
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
Comment 2 Hammer Attila 2008-11-20 19:55:19 UTC
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
Comment 3 Willie Walker 2009-01-05 16:03:00 UTC
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.  :-)
Comment 4 Hammer Attila 2009-01-06 08:59:24 UTC
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
Comment 5 Willie Walker 2009-01-06 14:35:19 UTC
(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?
Comment 6 Hammer Attila 2009-01-09 12:00:41 UTC
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):
  • File "/usr/local/lib/python2.5/site-packages/orca/input_event.py", line 186 in processInputEvent
    consumed = self.function(script, inputEvent)
  • File "/usr/local/lib/python2.5/site-packages/orca/structural_navigation.py", line 313 in goNext
    self.structuralNavigation.goObject(self, True)
  • File "/usr/local/lib/python2.5/site-packages/orca/structural_navigation.py", line 891 in goObject
    structuralNavigationObject.present(obj, arg)
  • File "/usr/local/lib/python2.5/site-packages/orca/structural_navigation.py", line 2588 in _headingPresentation
    self._presentObject(obj, characterOffset)
  • File "/usr/local/lib/python2.5/site-packages/orca/scripts/toolkits/Gecko/structural_navigation.py", line 144 in _presentObject
    self._script.speakContents(contents)
  • File "/usr/local/lib/python2.5/site-packages/orca/scripts/toolkits/Gecko/script.py", line 5368 in speakContents
    utterances = self.getUtterancesFromContents(contents, speakRole)
  • File "/usr/local/lib/python2.5/site-packages/orca/scripts/toolkits/Gecko/script.py", line 5326 in getUtterancesFromContents
    self.speechGenerator.getSpeechForObjectRole(heading))
  • File "/usr/local/lib/python2.5/site-packages/orca/scripts/toolkits/Gecko/speech_generator.py", line 104 in getSpeechForObjectRole
    rolenames.getSpeechForRoleName(obj, role)))
TypeError: int argument required

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
Comment 7 Hammer Attila 2009-01-09 12:25:20 UTC
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.
Comment 8 Willie Walker 2009-01-09 15:01:35 UTC
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 "<".
Comment 9 Hammer Attila 2009-01-09 15:34:56 UTC
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
Comment 10 Willie Walker 2009-01-09 20:58:08 UTC
(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.
Comment 11 Hammer Attila 2009-01-13 09:12:56 UTC
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
Comment 12 Willie Walker 2009-01-13 21:25:46 UTC
(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?
Comment 13 Hammer Attila 2009-01-14 07:44:45 UTC
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
Comment 14 Willie Walker 2009-01-14 19:26:58 UTC
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?
Comment 15 Hammer Attila 2009-01-14 19:36:38 UTC
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
Comment 16 Willie Walker 2009-01-14 21:50:35 UTC
(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?
Comment 17 Hammer Attila 2009-01-15 07:07:17 UTC
Yes, correct.

Attila
Comment 18 Hammer Attila 2009-01-16 13:33:15 UTC
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
Comment 19 Mesar Hameed 2009-01-16 14:37:32 UTC
Hi Atilla, yes, i can confirm the heading bug on that webpage, please open new bug. Thank you
Comment 20 Hammer Attila 2009-01-16 15:17:29 UTC
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
Comment 21 Joanmarie Diggs (IRC: joanie) 2009-01-20 22:49:37 UTC
Assigning to me so that it's on my radar.
Comment 22 Joanmarie Diggs (IRC: joanie) 2009-01-30 21:41:49 UTC
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?
Comment 23 Willie Walker 2009-01-30 23:06:55 UTC
(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.
Comment 24 Joanmarie Diggs (IRC: joanie) 2009-01-31 01:18:36 UTC
(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!
Comment 25 Willie Walker 2009-02-11 18:21:28 UTC
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?
Comment 26 Willie Walker 2009-02-11 18:24:05 UTC
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?
Comment 27 Willie Walker 2009-02-11 20:01:47 UTC
Created attachment 128489 [details] [review]
Rev 2 with regression test update included

Committed to trunk and string change announcement sent.
Comment 28 Willie Walker 2009-02-11 20:02:47 UTC
PS - I confirmed with Mike that the new behavior is OK.  Closing.
Comment 29 Hammer Attila 2009-02-12 11:31:31 UTC
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
Comment 30 Hammer Attila 2009-02-12 12:19:01 UTC
Where am I works correct my desktop machine, only problem with sayall and this interesting fuzzy problem.

Attila
Comment 31 Willie Walker 2009-02-12 13:42:32 UTC
(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
Comment 32 Hammer Attila 2009-02-12 14:30:04 UTC
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
Comment 33 Hammer Attila 2009-02-12 14:32:50 UTC
Created attachment 128565 [details]
This is the hungarian translation file.
Comment 34 Hammer Attila 2009-02-12 14:41:12 UTC
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
Comment 35 Willie Walker 2009-02-12 14:43:56 UTC
(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.
Comment 36 Willie Walker 2009-02-12 14:46:24 UTC
(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?
Comment 37 Hammer Attila 2009-02-12 15:08:37 UTC
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
Comment 38 Hammer Attila 2009-02-12 15:25:35 UTC
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

Comment 39 Willie Walker 2009-02-12 15:36:03 UTC
(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.
Comment 40 Hammer Attila 2009-02-12 16:40:48 UTC
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