diff options
author | Charles Kerr <charles.kerr@canonical.com> | 2012-08-31 11:28:21 -0500 |
---|---|---|
committer | Charles Kerr <charles.kerr@canonical.com> | 2012-08-31 11:28:21 -0500 |
commit | ed7d1fd6fd9d035156a15e8b0ed695de5e8e3f60 (patch) | |
tree | c19160b46c3fc1b4561a87e67014fdc61c22c2aa /src/indicator-session.c | |
parent | 64cf80553784cdee851cf7112fdc468ab46a61be (diff) | |
download | ayatana-indicator-session-ed7d1fd6fd9d035156a15e8b0ed695de5e8e3f60.tar.gz ayatana-indicator-session-ed7d1fd6fd9d035156a15e8b0ed695de5e8e3f60.tar.bz2 ayatana-indicator-session-ed7d1fd6fd9d035156a15e8b0ed695de5e8e3f60.zip |
revise indicator_session_update_a11y_from_disposition() to be easier to internationalize
Diffstat (limited to 'src/indicator-session.c')
-rw-r--r-- | src/indicator-session.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/indicator-session.c b/src/indicator-session.c index 72e3a0b..ec95328 100644 --- a/src/indicator-session.c +++ b/src/indicator-session.c @@ -431,22 +431,22 @@ static void indicator_session_update_a11y_from_disposition (IndicatorSession * indicator, int disposition) { - GString * a11y = g_string_new (_("System")); - - if (g_settings_get_boolean (indicator->settings, "show-real-name-on-panel")) - { - const gchar * username = gtk_label_get_text (indicator->entry.label); - g_string_append_printf (a11y, " %s", username); - } - - if (disposition != DISPOSITION_NORMAL) - { - g_string_append (a11y, _(" (Attention Required)")); - } + gchar * a11y; + const gchar * username = gtk_label_get_text (indicator->entry.label); + const gboolean need_attn = disposition != DISPOSITION_NORMAL; + const gboolean show_name = g_settings_get_boolean (indicator->settings, + "show-real-name-on-panel"); + + if (show_name && need_attn) + a11y = g_strdup_printf (_("System %s (Attention Required)"), username); + else if (show_name) + a11y = g_strdup_printf (_("System %s"), username); + else + a11y = g_strdup (_("System")); - g_debug (G_STRLOC" setting a11y to \"%s\"", a11y->str); + g_debug (G_STRLOC" setting a11y to \"%s\"", a11y); g_clear_pointer (&indicator->entry.accessible_desc, g_free); - indicator->entry.accessible_desc = g_string_free (a11y, FALSE); + indicator->entry.accessible_desc = a11y; g_signal_emit (indicator, INDICATOR_OBJECT_SIGNAL_ACCESSIBLE_DESC_UPDATE_ID, 0, |