[GCompris] RTL improvements

Johnny Jazeix jazeix at gmail.com
Fri May 20 18:26:57 BST 2022


Hi,

Le sam. 14 mai 2022 à 18:10, Daniel Shahaf <danielsh at apache.org> a écrit :

> Johnny Jazeix wrote on Thu, May 12, 2022 at 22:19:31 +0200:
> > Le mer. 27 avr. 2022 à 23:09, Daniel Shahaf <danielsh at apache.org> a
> écrit :
> >
> > > Johnny Jazeix wrote on Wed, Apr 27, 2022 at 21:52:02 +0200:
> > > > Hi,
> > > >
> > > > thanks for testing!
> > > >
> > > > Le mer. 27 avr. 2022 à 21:31, Daniel Shahaf <danielsh at apache.org> a
> > > écrit :
> > > >
> > > > > the "X" / "V" graphic is to its right.  That makes sense in LTR
> > > > > languages, but for RTL languages, where the "X" / "V" graphic of
> > > > > checkboxes is placed to the _right_ of the checkbox's text, the
> > > > > placement is misleading.
> > > > >
> > > > >
> > >
> >
> > I've added note to the task and I have fixed this one and the "About
> > dialog" too.
>
> Thanks!
>
> More below.
>
> > > > I've created https://phabricator.kde.org/T15482 to write all the
> > > > inconsistencies we have for RTL language, can you take a look and add
> > > > other issues?
> > >
> > > I have an issue with the identity.k.o registration; I'll follow up on
> > > that separately.  In the meantime, one more issue:
> > >
> > > - In Hebrew at least, the "About" screen aligns the first paragraph to
> > >   the right (correctly) but the following paragraphs to the left
> > >   (incorrectly).  The order of letters and words is correct, but it's
> > >   the left margin that aligns rather than the right one.  Reversed
> > >   example:
> > >
> > >             Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
> Ut
> > >         purus elit, vestibulum ut, placerat ac, adipiscing vitae,
> felis.
> > >         Curabitur dictum gravida mauris.  Nam arcu libero, nonummy
> eget,
> > >                                     consectetuer id, vulputate a,
> magna.
> > >
> > > > For example, the authors in the help are written: "<name <email.com"
> > > > where we expect "name <email>". What is the correct form in Hebrew
> > > > for this?
> > >
> > > Good question.  I suppose it should render as "name <email>", but in
> > > logical order, i.e., with name on the right.
> > >
> > > The po file writes the angle brackets as U+003C first and U+003E
> second,
> > > following rfc822's syntax as much as possible.  However, these two
> > > characters get mirrored in RTL contexts:
> > >
> > > [[[
> > > % unicode 003c
> > > U+003C LESS-THAN SIGN
> > > UTF-8: 3c UTF-16BE: 003c Decimal: < Octal: \074
> > > <
> > > Category: Sm (Symbol, Math); East Asian width: Na (narrow)
> > > Unicode block: 0000..007F; Basic Latin
> > > Bidi: ON (Other Neutrals)
> > >
> > > Character is mirrored
> > > ]]]
> > >
> > > This would be why in your example you get two "<" marks.  The one
> > > between "name" and "email" [in byte order] is a U+003C rendered
> > > mirrored, because it's preceded by an RTL character; the one after
> > > "email" [again in byte order] is a U+003E rendered normally, because
> > > it's preceded by an LTR character.
> > >
> > > I'm not sure how best to fix this.  Normally I'd consider explicit
> > > Unicode directionality characters (the po file already uses literal
> > > U+200E, for instance), but this is a pseudo rfc822 context, and I'm not
> > > sure whether email clients would DTRT with embedded directionality
> > > characters, should the line be copy-pasted into them (e.g., by
> > > a translator).  Perhaps we could sidestep the problem entirely by using
> > > <a href="mailto:…">[translator's name in Hebrew]</a> tags?  Or by
> moving
> > > the email addresses to a po comment; they _already_ aren't rendered (as
> > > of v2.4 on Linux).
> > >
> > >
> > For this one, I still don't have any fix. The mails are displayed but non
> > clickable
>
> Ah, so we have been talking past each other.
>
> I thought you were referring to the names and email addresses in the
> "translator-credits" line in core/DialogAbout.qml, and answered
> accordingly.  However, I see now you are referring to the names and
> addresses of activity authors, as given by "author" in ActivityInfo.qml
> and shown in an activity's help page.
>
> Translators names are given in the local language whereas activity
> authors' names are given in English.
>
> > (no link in the application is clickable at all because we don't want
> > children to wander on Internet :)).
>
> Well, that's security by obscurity, isn't it? :-)
>
>
Mmmmmh, it's more that we want the children to focus on the activities :-).


> > They are also not in the .po file because it does not seem to make
> > sense to translate people names/emails (maybe I'm wrong)?
>
> I don't know.
>
> Personally, I'm fine seeing the names untranslated because if I wanted
> to do anything with the names (e.g., to write to the person, or to look
> up what else they have worked on), I'd need to know the names in their
> untranslated form.
>
> Another case where it would be useful to translate authors' names is if
> the "author" string includes words or particles other than names.  For
> instance, in this string:
>
> land_safe/ActivityInfo.qml:13:  author: "Matilda Bernard  (Gtk+), Holger
> Kaelberer  (Qt Quick)"
>
> both the name "Qt Quick" and the comma are potentially translatable.
> (E.g., running Arabic text uses U+060C ARABIC COMMA in preference to
> the ASCII comma, but I don't know which comma ar.po would use in this
> context if it had the option.)
>
> > We can reverse the name/email programmably but there is still the
> > issue.
> > We added/fixed the display of the email contributor thanks to
> > https://bugs.kde.org/show_bug.cgi?id=349111 and if I'm not wrong, we
> > already received contributions/feedbacks thanks to it so it would be nice
> > to keep it.
>
> In the case of authors' names I think making the "Name <email>" part
> explicitly LTR even when localized to an RTL language would be
> appropriate.  This would be useful to all RTL languages and would be
> a no-op for LTR languages, so perhaps this? —
>
> [[[
> diff --git a/src/core/DialogHelp.qml b/src/core/DialogHelp.qml
> index 7155590..ba3dbbb 100644
> --- a/src/core/DialogHelp.qml
> +++ b/src/core/DialogHelp.qml
> @@ -46,7 +46,8 @@ DialogBackground {
>          var contentText = "<b>" + activityInfo.description + "</b>"
>          contentText += "<br/><br/>"
>          if(activityInfo.author) {
> -            contentText += "<b>" + qsTr("Author:") + " </b>" +
> activityInfo.author
> +            contentText += "<b>" + qsTr("Author:") + " </b>"
> +            contentText += "<span dir=\"ltr\">" + activityInfo.author +
> "</span>"
>              contentText += "<br/><br/>"
>          }
>          if(activityInfo.prerequisite) {
> ]]]
>
> I don't have a build environment to test that, sorry.  However, it
> should result in author names being rendered as "Name <email>" in both
> RTL and LTR languages, with correct angle brackets.
>
>
I didn't replied earlier because I tried multiple things without success.
According to
https://doc.qt.io/qt-5/richtext-html-subset.html#block-attributes, span do
not have
the "dir" attribute. I tried with <p> or <hx>, but the author is then
written in the next line, not directly following the "Author:".


> Cheers,
>
> Daniel
>
> > Cheers,
> >
> > Johnny
> >
> >
> > > Cheers,
> > >
> > > Daniel
> > >
> > > [1]
> > >
> https://en.wikipedia.org/wiki/Bidirectional_text#Table_of_possible_BiDi_character_types
> > >
> > >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/gcompris-devel/attachments/20220520/20cf3a10/attachment-0001.htm>


More information about the GCompris-devel mailing list