Line |
Branch |
Exec |
Source |
1 |
|
|
/* |
2 |
|
|
* Copyright (C) 2013 Red Hat, Inc |
3 |
|
|
* |
4 |
|
|
* This program is free software; you can redistribute it and/or |
5 |
|
|
* modify it under the terms of the GNU General Public License as |
6 |
|
|
* published by the Free Software Foundation; either version 2 of the |
7 |
|
|
* License, or (at your option) any later version. |
8 |
|
|
* |
9 |
|
|
* This program is distributed in the hope that it will be useful, but |
10 |
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of |
11 |
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
12 |
|
|
* General Public License for more details. |
13 |
|
|
* |
14 |
|
|
* You should have received a copy of the GNU General Public License |
15 |
|
|
* along with this program; if not, see <http://www.gnu.org/licenses/>. |
16 |
|
|
*/ |
17 |
|
|
|
18 |
|
|
#include <config.h> |
19 |
|
|
|
20 |
|
|
#ifdef HAVE_IBUS |
21 |
|
|
#include "cc-ibus-utils.h" |
22 |
|
|
|
23 |
|
|
gchar * |
24 |
|
✗ |
engine_get_display_name (IBusEngineDesc *engine_desc) |
25 |
|
|
{ |
26 |
|
|
const gchar *name; |
27 |
|
|
const gchar *language_code; |
28 |
|
|
const gchar *language; |
29 |
|
|
const gchar *textdomain; |
30 |
|
|
gchar *display_name; |
31 |
|
|
|
32 |
|
✗ |
name = ibus_engine_desc_get_longname (engine_desc); |
33 |
|
✗ |
language_code = ibus_engine_desc_get_language (engine_desc); |
34 |
|
✗ |
language = ibus_get_language_name (language_code); |
35 |
|
✗ |
textdomain = ibus_engine_desc_get_textdomain (engine_desc); |
36 |
|
✗ |
if (*textdomain != '\0' && *name != '\0') |
37 |
|
✗ |
name = g_dgettext (textdomain, name); |
38 |
|
✗ |
display_name = g_strdup_printf ("%s (%s)", language, name); |
39 |
|
|
|
40 |
|
✗ |
return display_name; |
41 |
|
|
} |
42 |
|
|
|
43 |
|
|
#endif /* HAVE_IBUS */ |
44 |
|
|
|