From 974331b825b2eec53a1a6530583cb0bd516e62be Mon Sep 17 00:00:00 2001 From: Daiki Ueno Date: Tue, 12 Mar 2013 12:06:32 +0900 Subject: [PATCH] status/keyboard: Translate IBus IME name if possible https://bugzilla.gnome.org/show_bug.cgi?id=695673 --- js/ui/status/keyboard.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/js/ui/status/keyboard.js b/js/ui/status/keyboard.js index e5eef5fd8..397df8a8c 100644 --- a/js/ui/status/keyboard.js +++ b/js/ui/status/keyboard.js @@ -9,6 +9,7 @@ const Meta = imports.gi.Meta; const Shell = imports.gi.Shell; const Signals = imports.signals; const St = imports.gi.St; +const Gettext = imports.gettext; try { var IBus = imports.gi.IBus; @@ -535,8 +536,12 @@ const InputSourceIndicator = new Lang.Class({ let engineDesc = this._ibusManager.getEngineDesc(id); if (engineDesc) { let language = IBus.get_language_name(engineDesc.get_language()); + let longName = engineDesc.get_longname(); + let textdomain = engineDesc.get_textdomain(); + if (textdomain != '') + longName = Gettext.dgettext(textdomain, longName); exists = true; - displayName = language + ' (' + engineDesc.get_longname() + ')'; + displayName = '%s (%s)'.format(language, longName); shortName = this._makeEngineShortName(engineDesc); } }