Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: aria label improvements #1226

Merged
merged 15 commits into from
Dec 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions data/dev.geopjr.Tuba.gschema.xml
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@
<key name="contributors" type="as">
<default>['1021928818','2964685538','2486375860','3456423266','1352322503','445941323','3177176442','2386917030','987913018','1837154139','4173902237','4223975552','3163563143','3320460562','4233664772','136476033','4041964504','3998595277','580879396','4086778421']</default>
</key>
<key name="status-aria-verbosity" type="i">
<default>3</default>
</key>

<key name="window-w" type="i">
<default>600</default>
Expand Down
1 change: 1 addition & 0 deletions data/ui/views/sidebar/view.ui
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@
<child>
<object class="GtkScrolledWindow">
<property name="vexpand">1</property>
<property name="focusable">0</property>
<property name="child">
<object class="GtkViewport">
<child>
Expand Down
82 changes: 44 additions & 38 deletions po/dev.geopjr.Tuba.pot
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-12-12 15:05+0200\n"
"POT-Creation-Date: 2024-12-14 19:52+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
Expand Down Expand Up @@ -168,7 +168,7 @@ msgstr ""
#: data/ui/dialogs/filter_edit.ui:16 data/ui/dialogs/new_account.ui:26
#: data/ui/dialogs/profile_edit.ui:21 data/ui/dialogs/schedule.ui:40
#: src/API/Relationship.vala:139 src/API/Relationship.vala:184
#: src/Application.vala:710 src/Dialogs/Admin/AddFederationBlock.vala:37
#: src/Application.vala:711 src/Dialogs/Admin/AddFederationBlock.vala:37
#: src/Dialogs/Admin/AddIPBlock.vala:76 src/Dialogs/Admin/Report.vala:22
#: src/Dialogs/Admin/TakeAction.vala:22 src/Dialogs/Admin/TakeAction.vala:147
#: src/Dialogs/Composer/AttachmentsPageAttachment.vala:54
Expand Down Expand Up @@ -232,7 +232,7 @@ msgstr ""

#: data/ui/dialogs/advanced_search.ui:121
#: src/Dialogs/Composer/AttachmentsPage.vala:62
#: src/Widgets/ProfileFilterGroup.vala:61
#: src/Widgets/ProfileFilterGroup.vala:66
msgid "Media"
msgstr ""

Expand Down Expand Up @@ -1424,28 +1424,28 @@ msgid "%s does not accept '%s://'"
msgstr ""

#. translators: Name <[email protected]> or Name https://website.example
#: src/Application.vala:630
#: src/Application.vala:631
msgid "translator-credits"
msgstr ""

#. translators: Wiki pages / Guides
#: src/Application.vala:634
#: src/Application.vala:635
msgid "Wiki"
msgstr ""

#: src/Application.vala:636 src/Widgets/Status.vala:352
#: src/Application.vala:637 src/Widgets/Status.vala:352
msgid "Translate"
msgstr ""

#: src/Application.vala:637
#: src/Application.vala:638
msgid "Donate"
msgstr ""

#: src/Application.vala:659
#: src/Application.vala:660
msgid "OK"
msgstr ""

#: src/Application.vala:709
#: src/Application.vala:710
msgid "Yes"
msgstr ""

Expand Down Expand Up @@ -2591,17 +2591,17 @@ msgid "%s Account"
msgstr ""

#. translators: Follow System's dark mode preference
#: src/Services/Settings.vala:262
#: src/Services/Settings.vala:264
msgid "Follow System"
msgstr ""

#. translators: Light mode theme
#: src/Services/Settings.vala:265
#: src/Services/Settings.vala:267
msgid "Light"
msgstr ""

#. translators: Dark mode theme
#: src/Services/Settings.vala:268
#: src/Services/Settings.vala:270
msgid "Dark"
msgstr ""

Expand Down Expand Up @@ -3105,7 +3105,7 @@ msgid "No Edit History"
msgstr ""

#: src/Views/Explore.vala:6 src/Views/Search.vala:114
#: src/Widgets/ProfileFilterGroup.vala:35
#: src/Widgets/ProfileFilterGroup.vala:40
msgid "Posts"
msgstr ""

Expand Down Expand Up @@ -3468,8 +3468,7 @@ msgstr ""

#. translators: Tooltip text for avatars in posts.
#. The variable is a string user handle.
#: src/Widgets/AccountSuggestions.vala:15 src/Widgets/Status.vala:702
#: src/Widgets/Status.vala:1036
#: src/Widgets/AccountSuggestions.vala:15 src/Widgets/Status.vala:1041
#, c-format
msgid "Open %s's Profile"
msgstr ""
Expand Down Expand Up @@ -3578,7 +3577,7 @@ msgstr ""
#. Screen reader users are going to hear this a lot,
#. please be mindful.
#. The variable is a string date.
#: src/Widgets/Announcement.vala:31 src/Widgets/Status.vala:793
#: src/Widgets/Announcement.vala:31 src/Widgets/Status.vala:795
#, c-format
msgid "Edited: %s."
msgstr ""
Expand All @@ -3587,7 +3586,7 @@ msgstr ""
#. Screen reader users are going to hear this a lot,
#. please be mindful.
#. The variable is a string date.
#: src/Widgets/Announcement.vala:36 src/Widgets/Status.vala:798
#: src/Widgets/Announcement.vala:36 src/Widgets/Status.vala:800
#, c-format
msgid "Published: %s."
msgstr ""
Expand All @@ -3597,7 +3596,7 @@ msgstr ""
#. please be mindful.
#. The variable is the amount of reactions the post
#. has.
#: src/Widgets/Announcement.vala:46 src/Widgets/Status.vala:875
#: src/Widgets/Announcement.vala:46 src/Widgets/Status.vala:877
#, c-format
msgid "Contains %d reaction."
msgid_plural "Contains %d reactions."
Expand Down Expand Up @@ -3777,14 +3776,14 @@ msgstr ""
msgid "Error: Note is over 2000 characters long"
msgstr ""

#: src/Widgets/ProfileFilterGroup.vala:49
#: src/Widgets/ProfileFilterGroup.vala:54
msgid "Replies"
msgstr ""

#. translators: the variable is the emoji or its name if it's custom.
#. A reaction is not the same as a favorite or a boost,
#. see https://github.com/glitch-soc/mastodon/pull/2462
#: src/Widgets/ReactButton.vala:35
#: src/Widgets/ReactButton.vala:37
#, c-format
msgid "React with %s"
msgstr ""
Expand Down Expand Up @@ -3938,6 +3937,13 @@ msgstr ""
msgid "Couldn't translate: %s"
msgstr ""

#. translators: Tooltip text for avatars in posts.
#. The variable is a string user handle.
#: src/Widgets/Status.vala:702
#, c-format
msgid "Open %s's Mini Profile"
msgstr ""

#. translators: Unpin post from profile
#: src/Widgets/Status.vala:754
msgid "Unpin"
Expand All @@ -3946,7 +3952,7 @@ msgstr ""
#. translators: This is an accessibility label.
#. Screen reader users are going to hear this a lot,
#. please be mindful.
#: src/Widgets/Status.vala:765
#: src/Widgets/Status.vala:767
msgid "Filtered post"
msgstr ""

Expand All @@ -3956,30 +3962,30 @@ msgstr ""
#. The first variable is the post's visibility (e.g. public).
#. The second one is the author's name and the third
#. one is the author's handle.
#: src/Widgets/Status.vala:781
#: src/Widgets/Status.vala:783
#, c-format
msgid "%s post by %s (%s)."
msgstr ""

#. translators: This is an accessibility label.
#. Screen reader users are going to hear this a lot,
#. please be mindful.
#: src/Widgets/Status.vala:805
#: src/Widgets/Status.vala:807
msgid "The post is pinned."
msgstr ""

#. translators: This is an accessibility label.
#. Screen reader users are going to hear this a lot,
#. please be mindful.
#: src/Widgets/Status.vala:813
#: src/Widgets/Status.vala:815
msgid "Contains a quoted post."
msgstr ""

#. translators: This is an accessibility label.
#. Screen reader users are going to hear this a lot,
#. please be mindful.
#. The variable is the number of attachments the post has.
#: src/Widgets/Status.vala:823
#: src/Widgets/Status.vala:825
#, c-format
msgid "Contains %d attachment."
msgid_plural "Contains %d attachments."
Expand All @@ -3989,29 +3995,29 @@ msgstr[1] ""
#. translators: This is an accessibility label.
#. Screen reader users are going to hear this a lot,
#. please be mindful.
#: src/Widgets/Status.vala:834
#: src/Widgets/Status.vala:836
msgid "Contains an expired poll."
msgstr ""

#. translators: This is an accessibility label.
#. Screen reader users are going to hear this a lot,
#. please be mindful.
#: src/Widgets/Status.vala:838
#: src/Widgets/Status.vala:840
msgid "Contains a poll."
msgstr ""

#. translators: This is an accessibility label.
#. Screen reader users are going to hear this a lot,
#. please be mindful.
#: src/Widgets/Status.vala:847
#: src/Widgets/Status.vala:849
msgid "The post has a spoiler."
msgstr ""

#. translators: This is an accessibility label.
#. Screen reader users are going to hear this a lot,
#. please be mindful.
#. The variable is the spoiler title.
#: src/Widgets/Status.vala:853
#: src/Widgets/Status.vala:855
#, c-format
msgid "The post has the following spoiler: %s."
msgstr ""
Expand All @@ -4021,26 +4027,26 @@ msgstr ""
#. please be mindful.
#. The variable is the name of the app the post was
#. made with (e.g. Tuba).
#: src/Widgets/Status.vala:864
#: src/Widgets/Status.vala:866
#, c-format
msgid "Posted using %s."
msgstr ""

#: src/Widgets/Status.vala:887
#: src/Widgets/Status.vala:891
#, c-format
msgid "%s reply"
msgid_plural "%s replies"
msgstr[0] ""
msgstr[1] ""

#: src/Widgets/Status.vala:892
#: src/Widgets/Status.vala:896
#, c-format
msgid "%s boost"
msgid_plural "%s boosts"
msgstr[0] ""
msgstr[1] ""

#: src/Widgets/Status.vala:897
#: src/Widgets/Status.vala:901
#, c-format
msgid "%s favorite"
msgid_plural "%s favorites"
Expand All @@ -4051,28 +4057,28 @@ msgstr[1] ""
#. Screen reader users are going to hear this a lot,
#. please be mindful.
#. This is used to announce the quoted post
#: src/Widgets/Status.vala:932
#: src/Widgets/Status.vala:937
msgid "Quoted Post"
msgstr ""

#: src/Widgets/Status.vala:953
#: src/Widgets/Status.vala:958
#, c-format
msgid "Filtered: %s"
msgstr ""

#: src/Widgets/Status.vala:955
#: src/Widgets/Status.vala:960
msgid "Filtered"
msgstr ""

#. translatiors: the first variable is a language name,
#. the second variable is a service name e.g. DeepL
#: src/Widgets/Status.vala:1091
#: src/Widgets/Status.vala:1096
#, c-format
msgid "Translated from %s using %s"
msgstr ""

#. translatiors: the variable is a service name e.g. DeepL
#: src/Widgets/Status.vala:1094
#: src/Widgets/Status.vala:1099
#, c-format
msgid "Translated using %s"
msgstr ""
Expand Down
2 changes: 1 addition & 1 deletion src/Dialogs/Composer/AttachmentsPageAttachment.vala
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ public class Tuba.AttachmentsPageAttachment : Widgets.Attachment.Item {

public override void unmap () {
// Causes the dialog to not get destroyed
// so let's unbound manually
// so let's unbind manually
pos_x_binding.unbind ();
pos_y_binding.unbind ();
base.unmap ();
Expand Down
8 changes: 5 additions & 3 deletions src/Services/Settings.vala
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ public class Tuba.Settings : GLib.Settings {
public string last_analytics_update { get; set; }
public string last_contributors_update { get; set; }
public string[] contributors { get; set; default = {}; }
public int status_aria_verbosity { get; set; default = 3; }

private static string[] keys_to_init = {
"active-account",
Expand Down Expand Up @@ -187,7 +188,8 @@ public class Tuba.Settings : GLib.Settings {
"proxy",
"dim-trivial-notifications",
"analytics",
"update-contributors"
"update-contributors",
"status-aria-verbosity"
};

public Settings () {
Expand Down Expand Up @@ -223,7 +225,7 @@ public class Tuba.Settings : GLib.Settings {
this.apply ();
}

private string[] sensitive_keys = {
private const string[] SENSITIVE_KEYS = {
"proxy",
"active-account",
"last-analytics-update",
Expand All @@ -236,7 +238,7 @@ public class Tuba.Settings : GLib.Settings {
builder.begin_object ();

foreach (string key in keys_to_init) {
if (key in sensitive_keys) continue;
if (key in SENSITIVE_KEYS) continue;

var val = Value (Type.STRING);
this.get_property (key, ref val);
Expand Down
6 changes: 4 additions & 2 deletions src/Widgets/Emoji.vala
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
public class Tuba.Widgets.Emoji : Adw.Bin {

protected Gtk.Image image;
public string? shortcode { get; set; }
public int pixel_size {
Expand All @@ -11,8 +10,11 @@ public class Tuba.Widgets.Emoji : Adw.Bin {
set { image.icon_size = value; }
}

static construct {
set_accessible_role (Gtk.AccessibleRole.IMG);
}

construct {
this.set_accessible_role (Gtk.AccessibleRole.IMG);
image = new Gtk.Image () {
css_classes = { "lww-emoji" }
};
Expand Down
4 changes: 4 additions & 0 deletions src/Widgets/EmojiLabel.vala
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ public class Tuba.Widgets.EmojiLabel : Tuba.Widgets.LabelWithWidgets {
public bool smaller_emoji_pixel_size { get; set; default=false; }
public bool large_emojis { get; set; default=false; }

static construct {
set_accessible_role (Gtk.AccessibleRole.LABEL);
}

private string _content = "";
public string content { get {return _content;}
set {
Expand Down
Loading
Loading