GNOME Bugzilla – Bug 694117
Add atk_object_get_locale()
Last modified: 2013-02-19 11:50:33 UTC
Currently we have atk_document_get_locale(). This is insufficient for the following reasons: * individual objects within documents (html, libreoffice) can have their own locales * applications can be launched in a locale other than the session's With respect to the latter item, Orca users would like Orca to be able to present text and widgets using the speech synthesizer associated with the object's locale. But if an application has a different locale than the session's default locale, we wind up with a mixture of languages such as: SPEECH OUTPUT: 'Szöveg tördelése Sortörés engedélyezése jelölőnégyzet checked' I can easily solve this problem if I know the locale of the widget. Please and thank you. :)
(In reply to comment #0) > Currently we have atk_document_get_locale(). This is insufficient for the > following reasons: > > * individual objects within documents (html, libreoffice) can have > their own locales > * applications can be launched in a locale other than the session's > > With respect to the latter item, Orca users would like Orca to be able to > present text and widgets using the speech synthesizer associated with the > object's locale. But if an application has a different locale than the > session's default locale, we wind up with a mixture of languages such as: > > SPEECH OUTPUT: 'Szöveg tördelése Sortörés engedélyezése jelölőnégyzet checked' > > I can easily solve this problem if I know the locale of the widget. As talked via IRC, for this, the easier would be add a new method on atk_object: * Add virtual atk_object_get_locale method as requested * Default implementation could be a call to setlocale (LC_MESSAGES, NULL) * Deprecate atk_document_get_locale Will try to have this method added today, as is release day for the freeze release.
Created attachment 236654 [details] [review] Add atk_object_get_accessible_locale In the end I called this new method "atk_object_get_accessible_locale" in order to avoid any possible name conflict with any other atk_xxx_get_locale method, included the soon to be deprecated (next patch) atk_document_get_locale. This name convection is the one used at atk_image_get_image_locale.
Created attachment 236655 [details] [review] Deprecate atk_document_get_locale Deprecate atk_document_get_locale in favor of atk_object_get_accessible_locale.
Created attachment 236657 [details] A little test using the new API added Just in case someone is curious, a little gtk test using the new API
Comment on attachment 236654 [details] [review] Add atk_object_get_accessible_locale After a change on the method name (atk_object_get_object_locale) this patch was committed
Looks like an #include <locale.h> is missing here, causing build failures for me: atkobject.c:1567:3: warning: implicit declaration of function 'setlocale' -Wimplicit-function-declaration] atkobject.c:1567:21: error: 'LC_MESSAGES' undeclared (first use in this function)
(In reply to comment #6) > Looks like an #include <locale.h> is missing here, causing build failures for > me: > > atkobject.c:1567:3: warning: implicit declaration of function 'setlocale' > -Wimplicit-function-declaration] > atkobject.c:1567:21: error: 'LC_MESSAGES' undeclared (first use in this > function) Oddly enough, I didn't have that problem. Anyway, just in case, I added the explicit #include <locale.h> on atkobject.c, committed it and rolled a new release including that change: download.gnome.org/sources/atk/2.7/atk-2.7.91.tar.xz Thanks for the feedback