diff options
author | Robert Tari <robert@tari.in> | 2021-04-16 00:29:00 +0200 |
---|---|---|
committer | Robert Tari <robert@tari.in> | 2021-04-16 00:29:00 +0200 |
commit | 39b1efc45ef974bd99ab195c155a4e593b038760 (patch) | |
tree | 875748e51a3c923cda284f26cb0667226764e874 | |
parent | 8f32270e910ba6e87dbf2909f4442dfcc724d7fa (diff) | |
download | ayatana-indicator-keyboard-39b1efc45ef974bd99ab195c155a4e593b038760.tar.gz ayatana-indicator-keyboard-39b1efc45ef974bd99ab195c155a4e593b038760.tar.bz2 ayatana-indicator-keyboard-39b1efc45ef974bd99ab195c155a4e593b038760.zip |
src/keyboard.c: Get languages via lookupLanguage()
-rw-r--r-- | src/keyboard.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/keyboard.c b/src/keyboard.c index e88a3583..11c6d93f 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -16,6 +16,7 @@ #include <X11/XKBlib.h> #include <libxklavier/xklavier.h> +#include "languages.h" #include "keyboard.h" enum @@ -165,13 +166,13 @@ static void onParseLayouts(XklConfigRegistry *pRegistry, const XklConfigItem * p if (pLayoutParser->sLayout) { pLayout->sId = g_strjoin("+", pLayoutParser->sLayout, pItem->name, NULL); - pLayout->sLanguage = g_strdup(pLayoutParser->sLanguage); + pLayout->sLanguage = g_strdup(lookupLanguage(pLayout->sId)); pLayout->sDescription = g_strdup(pItem->description); } else { pLayout->sId = g_strdup(pItem->name); - pLayout->sLanguage = g_strdup(pItem->short_description); + pLayout->sLanguage = g_strdup(lookupLanguage(pLayout->sId)); pLayout->sDescription = g_strdup(pItem->description); } @@ -182,7 +183,7 @@ static void onParseLayouts(XklConfigRegistry *pRegistry, const XklConfigItem * p LayoutParser cLayoutParser; cLayoutParser.sLayout = pItem->name; cLayoutParser.pKeyboard = pLayoutParser->pKeyboard; - cLayoutParser.sLanguage = pItem->short_description; + cLayoutParser.sLanguage = lookupLanguage(cLayoutParser.sLayout); xkl_config_registry_foreach_layout_variant(pRegistry, pItem->name, onParseLayouts, &cLayoutParser); } @@ -237,7 +238,7 @@ void keyboard_GetLayout(Keyboard *pKeyboard, gint nLayout, gchar **pLanguage, gc if (pLanguage != NULL) { - *pLanguage = g_strndup(pLayout->sLanguage, 2); + *pLanguage = g_strdup(pLayout->sLanguage); } if (pDescription != NULL) |