From f1416ee304e6025e9b65270e6ab5810153632ad4 Mon Sep 17 00:00:00 2001 From: William Hua Date: Wed, 28 Aug 2013 23:08:44 +0800 Subject: Append input source suffix to accessible-desc. --- lib/main.vala | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/main.vala b/lib/main.vala index d8b6588e..cf196650 100644 --- a/lib/main.vala +++ b/lib/main.vala @@ -366,7 +366,8 @@ public class Indicator.Keyboard.Service : Object { var builder = new VariantBuilder (new VariantType ("a{sv}")); builder.add ("{sv}", "visible", new Variant.boolean (visible)); if (name != null) { - builder.add ("{sv}", "accessible-desc", new Variant.string ((!) name)); + var suffix = _ ("input source"); + builder.add ("{sv}", "accessible-desc", new Variant.string (@"$((!) name) $suffix")); } if (icon != null) { builder.add ("{sv}", "icon", ((!) icon).serialize ()); -- cgit v1.2.3 From 807c6d8708d93d49c20ab14f13e343828d0bf3df Mon Sep 17 00:00:00 2001 From: William Hua Date: Thu, 29 Aug 2013 10:22:25 +0800 Subject: Use printf-style format string instead. --- lib/main.vala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/main.vala b/lib/main.vala index cf196650..7aac365c 100644 --- a/lib/main.vala +++ b/lib/main.vala @@ -366,8 +366,8 @@ public class Indicator.Keyboard.Service : Object { var builder = new VariantBuilder (new VariantType ("a{sv}")); builder.add ("{sv}", "visible", new Variant.boolean (visible)); if (name != null) { - var suffix = _ ("input source"); - builder.add ("{sv}", "accessible-desc", new Variant.string (@"$((!) name) $suffix")); + var description = _ ("%s input source").printf ((!) name); + builder.add ("{sv}", "accessible-desc", new Variant.string (description)); } if (icon != null) { builder.add ("{sv}", "icon", ((!) icon).serialize ()); -- cgit v1.2.3