Bumped to 1.5.20

This commit is contained in:
Takao Fujiwara 2019-03-01 21:43:00 +09:00
parent b2f9c21be9
commit b8c345fa3b
4 changed files with 154 additions and 6 deletions

1
.gitignore vendored
View File

@ -58,3 +58,4 @@ ibus-1.3.6.tar.gz
/ibus-1.5.17.tar.gz
/ibus-1.5.18.tar.gz
/ibus-1.5.19.tar.gz
/ibus-1.5.20.tar.gz

147
ibus-HEAD.patch Normal file
View File

@ -0,0 +1,147 @@
From 49c4fdd0a30d07fe1ba73644aca44a4732c03e1f Mon Sep 17 00:00:00 2001
From: fujiwarat <takao.fujiwara1@gmail.com>
Date: Wed, 27 Feb 2019 19:45:06 +0900
Subject: [PATCH] src: Make ISO 639 language names with title
Danish translations are small in iso-codes-iso-639-2-da.po for the
genral usage but the users ask the title format on UI.
Now ibus_get_language_name() and ibus_get_untranslated_language_name()
return the dynamic allocation instead of the static characters
to make the capital character.
BUG=https://github.com/ibus/ibus/issues/2079
---
src/ibusutil.c | 63 ++++++++++++++++++++++++++++++++++++++++++--------
src/ibusutil.h | 8 +++----
2 files changed, 58 insertions(+), 13 deletions(-)
diff --git a/src/ibusutil.c b/src/ibusutil.c
index fd1da006..9d003e2e 100644
--- a/src/ibusutil.c
+++ b/src/ibusutil.c
@@ -2,7 +2,7 @@
/* vim:set et sts=4: */
/* bus - The Input Bus
* Copyright (C) 2008-2015 Peng Huang <shawn.p.huang@gmail.com>
- * Copyright (C) 2010-2017 Takao Fujiwara <takao.fujiwara1@gmail.com>
+ * Copyright (C) 2010-2018 Takao Fujiwara <takao.fujiwara1@gmail.com>
* Copyright (C) 2008-2016 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
@@ -125,8 +125,8 @@ _load_lang()
ibus_xml_free (node);
}
-const gchar *
-ibus_get_untranslated_language_name (const gchar *_locale)
+const static gchar *
+ibus_get_untranslated_raw_language_name (const gchar *_locale)
{
const gchar *retval;
gchar *p = NULL;
@@ -148,19 +148,64 @@ ibus_get_untranslated_language_name (const gchar *_locale)
return "Other";
}
-const gchar *
+static char *
+get_first_item_in_semicolon_list (const char *list)
+{
+ char **items;
+ char *item;
+
+ items = g_strsplit (list, "; ", 2);
+
+ item = g_strdup (items[0]);
+ g_strfreev (items);
+
+ return item;
+}
+
+static char *
+capitalize_utf8_string (const char *str)
+{
+ char first[8] = { 0 };
+
+ if (!str)
+ return NULL;
+
+ g_unichar_to_utf8 (g_unichar_totitle (g_utf8_get_char (str)), first);
+
+ return g_strconcat (first, g_utf8_offset_to_pointer (str, 1), NULL);
+}
+
+gchar *
+ibus_get_untranslated_language_name (const gchar *_locale)
+{
+ const gchar *raw = ibus_get_untranslated_raw_language_name (_locale);
+ gchar *tmp = get_first_item_in_semicolon_list (raw);
+ gchar *retval = capitalize_utf8_string (tmp);
+ g_free (tmp);
+ return retval;
+}
+
+gchar *
ibus_get_language_name (const gchar *_locale)
{
- const gchar *retval = ibus_get_untranslated_language_name (_locale);
+ const gchar *raw = ibus_get_untranslated_raw_language_name (_locale);
+ const gchar *translation = NULL;
+ gchar *tmp;
+ gchar *retval;
#ifdef ENABLE_NLS
- if (g_strcmp0 (retval, "Other") == 0)
- return dgettext (GETTEXT_PACKAGE, N_("Other"));
+ if (g_strcmp0 (raw, "Other") == 0)
+ return g_strdup (dgettext (GETTEXT_PACKAGE, N_("Other")));
else
- return dgettext ("iso_639-3", retval);
+ translation = dgettext ("iso_639-3", raw);
#else
- return retval;
+ translation = raw;
#endif
+
+ tmp = get_first_item_in_semicolon_list (translation);
+ retval = capitalize_utf8_string (tmp);
+ g_free (tmp);
+ return retval;
}
void
diff --git a/src/ibusutil.h b/src/ibusutil.h
index 226dd7a8..795365f6 100644
--- a/src/ibusutil.h
+++ b/src/ibusutil.h
@@ -2,8 +2,8 @@
/* vim:set et sts=4: */
/* bus - The Input Bus
* Copyright (C) 2008-2015 Peng Huang <shawn.p.huang@gmail.com>
- * Copyright (C) 2010-2017 Takao Fujiwara <takao.fujiwara1@gmail.com>
- * Copyright (C) 2008-2016 Red Hat, Inc.
+ * Copyright (C) 2010-2018 Takao Fujiwara <takao.fujiwara1@gmail.com>
+ * Copyright (C) 2008-2018 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -42,7 +42,7 @@
*
* Returns: untranslated language name
*/
-const gchar * ibus_get_untranslated_language_name
+gchar * ibus_get_untranslated_language_name
(const gchar *_locale);
/**
@@ -51,6 +51,6 @@ const gchar * ibus_get_untranslated_language_name
*
* Returns: translated language name
*/
-const gchar * ibus_get_language_name (const gchar *_locale);
+gchar * ibus_get_language_name (const gchar *_locale);
#endif
--
2.20.1

View File

@ -34,15 +34,14 @@
%global dbus_python_version 0.83.0
Name: ibus
Version: 1.5.19
Release: 18%{?dist}
Version: 1.5.20
Release: 1%{?dist}
Summary: Intelligent Input Bus for Linux OS
License: LGPLv2+
URL: https://github.com/ibus/%name/wiki
Source0: https://github.com/ibus/%name/releases/download/%{version}/%{name}-%{version}.tar.gz
Source1: %{name}-xinput
Source2: %{name}.conf.5
Source3: https://fujiwara.fedorapeople.org/ibus/po/%{name}-po-1.5.19-20180822.tar.gz
# Patch0: %%{name}-HEAD.patch
Patch0: %{name}-HEAD.patch
# Under testing #1349148 #1385349 #1350291 #1406699 #1432252 #1601577
@ -238,7 +237,6 @@ The ibus-devel-docs package contains developer documentation for IBus
# cp client/gtk2/ibusimcontext.c client/gtk3/ibusimcontext.c || :
cp client/gtk2/ibusimcontext.c client/gtk3/ibusimcontext.c || :
zcat %SOURCE3 | tar xfv -
# prep test
diff client/gtk2/ibusimcontext.c client/gtk3/ibusimcontext.c
@ -434,6 +432,9 @@ dconf update || :
%{_datadir}/gtk-doc/html/*
%changelog
* Thu Feb 28 2019 Takao Fujiwara <tfujiwar@redhat.com> - 1.5.20-1
- Bumped to 1.5.20
* Thu Feb 28 2019 Pete Walter <pwalter@fedoraproject.org> - 1.5.19-18
- Update wayland deps

View File

@ -1,2 +1 @@
SHA512 (ibus-1.5.19.tar.gz) = ddcd464c9afb6d081df1cfac65069506877eb4818c3ba5594bcf76f3c6795ef6c17177a778dc89b2ef69d10d87297aa12c8e04f156b750e500b51b32787bd9fc
SHA512 (ibus-po-1.5.19-20180822.tar.gz) = 6a1a5164b6c5ddac4534b617b8f5fbd8134b4ce28731de8ba5712e3c4a816edd4a190591ae14ef90ec420b1038e7f3f5fbd761ecac821625c34ff93889eeed44
SHA512 (ibus-1.5.20.tar.gz) = 2bbcc19742882fa55d9c8704251f133c5be9f36a93cf52d70c460a4713419868deb634f965e67c1d5c45b615de388b92c0fbb863b118a546fbb89370a38eb77b