Language hint for widgets

In browser, I can mark any HTML tag with lang attribute (mozilla documentation) and so screen reader when it stumbles upon paragraph or other section that is in different language, can adjust and read text there correctly.

But, it seems like GTK doesnt have any such annotations, or at least I could not found them, and developers behind tuba mastodon client could not too, and there support for that would really make it easier to use when it does not assumes that entire internet is writing in my current language, like on any web-client where I can just let screen reader read any post that has correct lang attribute attached in HTML.

I would really like to know what needs to be done to support multiple languages. Or if such feature is even wanted.

Widgets have a text direction that you can set explicitly with gtk_widget_set_text_direction().

but thats only responsible for text direction, and not for helping screen reader pronouncing given text.

So… with ATK I would have just to set language attribute, but from what I understand now in gtk4 everything is done with GtkAccessible, which at most from what I see has:

  • Gtk.Acessible:accessible-role
  • Gtk.AccessibleText.get_attributes

but both dont seem to me to be the things that would do anything here.