src: s/iso_639-3/iso_639_3/ in ibus_get_language_name()

iso-codes 3.66 has iso_639_3.xml only but 3.67 has both iso_639_3.xml
and iso_639-3.xml. RHEL 7 uses iso-codes 3.46.

BUG=https://github.com/ibus/ibus/issues/2101
This commit is contained in:
fujiwarat 2019-06-24 17:28:55 +09:00
Родитель 82a728de97
Коммит 8025448407
2 изменённых файлов: 8 добавлений и 8 удалений

Просмотреть файл

@ -3,7 +3,7 @@
# ibus - The Input Bus
#
# Copyright (c) 2007-2010 Peng Huang <shawn.p.huang@gmail.com>
# Copyright (c) 2007-2010 Red Hat, Inc.
# Copyright (c) 2007-2019 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
@ -36,7 +36,7 @@ def get_language_name(_locale):
lang = lang.lower()
if lang in __languages_dict:
lang = __languages_dict[lang]
lang = gettext.dgettext("iso_639-3", lang)
lang = gettext.dgettext("iso_639_3", lang)
else:
lang = _(u"Other")
lang = gettext.dgettext("ibus", lang)
@ -62,7 +62,7 @@ def __char_data(data):
def __load_lang():
import os
import _config
iso_639_3_xml = os.path.join(_config.ISOCODES_PREFIX, "share/xml/iso-codes/iso_639-3.xml")
iso_639_3_xml = os.path.join(_config.ISOCODES_PREFIX, "share/xml/iso-codes/iso_639_3.xml")
p = xml.parsers.expat.ParserCreate()
p.StartElementHandler = __start_element
p.EndElementHandler = __end_element

Просмотреть файл

@ -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-2018 Takao Fujiwara <takao.fujiwara1@gmail.com>
* Copyright (C) 2010-2019 Takao Fujiwara <takao.fujiwara1@gmail.com>
* Copyright (C) 2008-2016 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
@ -99,14 +99,14 @@ _load_lang()
struct stat buf;
#ifdef ENABLE_NLS
bindtextdomain ("iso_639-3", LOCALEDIR);
bind_textdomain_codeset ("iso_639-3", "UTF-8");
bindtextdomain ("iso_639_3", LOCALEDIR);
bind_textdomain_codeset ("iso_639_3", "UTF-8");
#endif
__languages_dict = g_hash_table_new_full (g_str_hash,
g_str_equal, g_free, g_free);
filename = g_build_filename (ISOCODES_PREFIX,
"share/xml/iso-codes/iso_639-3.xml",
"share/xml/iso-codes/iso_639_3.xml",
NULL);
if (g_stat (filename, &buf) != 0) {
g_warning ("Can not get stat of file %s", filename);
@ -197,7 +197,7 @@ ibus_get_language_name (const gchar *_locale)
if (g_strcmp0 (raw, "Other") == 0)
return g_strdup (dgettext (GETTEXT_PACKAGE, N_("Other")));
else
translation = dgettext ("iso_639-3", raw);
translation = dgettext ("iso_639_3", raw);
#else
translation = raw;
#endif