Skip to content
Commits on Source (10)
......@@ -15,7 +15,7 @@
@SET_MAKE@
# aminclude_static.am generated automatically by Autoconf
# from AX_AM_MACROS_STATIC on Fri Sep 4 12:06:28 CEST 2020
# from AX_AM_MACROS_STATIC on Sat Oct 10 21:31:04 CEST 2020
VPATH = @srcdir@
am__is_gnu_make = { \
......
News in 1.9.1, 2020-10-10
-------------------------
* gspell_language_get_name() is now implemented with the ICU library, not with
the iso-codes package. As a result, gspell no longer depends on the
iso-codes, and has the ICU as a new dependency.
* Translation updates.
News in 1.8.4, 2020-09-04
-------------------------
* Translation updates.
......
gspell - a spell-checking library for GTK applications
======================================================
This is version 1.8.4 of gspell.
This is version 1.9.1 of gspell.
gspell provides a flexible API to add spell-checking to a GTK application.
......@@ -27,7 +27,7 @@ Dependencies
* GLib >= 2.44
* GTK >= 3.20
* Enchant >= 2.1.3
* iso-codes
* ICU - http://site.icu-project.org/
Notes for packagers
-------------------
......
# aminclude_static.am generated automatically by Autoconf
# from AX_AM_MACROS_STATIC on Fri Sep 4 12:06:28 CEST 2020
# from AX_AM_MACROS_STATIC on Sat Oct 10 21:31:04 CEST 2020
# Code coverage
......
......@@ -55,9 +55,6 @@
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* ISO codes prefix */
#undef ISO_CODES_PREFIX
/* Define to the sub-directory where libtool stores uninstalled libraries. */
#undef LT_OBJDIR
......
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for gspell 1.8.4.
# Generated by GNU Autoconf 2.69 for gspell 1.9.1.
#
# Report bugs to <https://gitlab.gnome.org/GNOME/gspell/issues>.
#
......@@ -590,8 +590,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='gspell'
PACKAGE_TARNAME='gspell'
PACKAGE_VERSION='1.8.4'
PACKAGE_STRING='gspell 1.8.4'
PACKAGE_VERSION='1.9.1'
PACKAGE_STRING='gspell 1.9.1'
PACKAGE_BUGREPORT='https://gitlab.gnome.org/GNOME/gspell/issues'
PACKAGE_URL='https://wiki.gnome.org/Projects/gspell'
 
......@@ -1453,7 +1453,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures gspell 1.8.4 to adapt to many kinds of systems.
\`configure' configures gspell 1.9.1 to adapt to many kinds of systems.
 
Usage: $0 [OPTION]... [VAR=VALUE]...
 
......@@ -1523,7 +1523,7 @@ fi
 
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of gspell 1.8.4:";;
short | recursive ) echo "Configuration of gspell 1.9.1:";;
esac
cat <<\_ACEOF
 
......@@ -1683,7 +1683,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
gspell configure 1.8.4
gspell configure 1.9.1
generated by GNU Autoconf 2.69
 
Copyright (C) 2012 Free Software Foundation, Inc.
......@@ -1999,7 +1999,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
 
It was created by gspell $as_me 1.8.4, which was
It was created by gspell $as_me 1.9.1, which was
generated by GNU Autoconf 2.69. Invocation command line was
 
$ $0 $@
......@@ -2925,7 +2925,7 @@ fi
 
# Define the identity of the package.
PACKAGE='gspell'
VERSION='1.8.4'
VERSION='1.9.1'
 
 
cat >>confdefs.h <<_ACEOF
......@@ -14531,7 +14531,7 @@ fi
 
 
AX_PACKAGE_REQUIRES="$AX_PACKAGE_REQUIRES glib-2.0 >= $glib_req gtk+-3.0 >= $gtk_req enchant-2 >= $enchant_req"
AX_PACKAGE_REQUIRES_PRIVATE="$AX_PACKAGE_REQUIRES_PRIVATE "
AX_PACKAGE_REQUIRES_PRIVATE="$AX_PACKAGE_REQUIRES_PRIVATE icu-uc"
 
 
pkg_failed=no
......@@ -14542,12 +14542,12 @@ if test -n "$DEP_CFLAGS"; then
pkg_cv_DEP_CFLAGS="$DEP_CFLAGS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glib-2.0 >= \$glib_req gtk+-3.0 >= \$gtk_req enchant-2 >= \$enchant_req \""; } >&5
($PKG_CONFIG --exists --print-errors "glib-2.0 >= $glib_req gtk+-3.0 >= $gtk_req enchant-2 >= $enchant_req ") 2>&5
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glib-2.0 >= \$glib_req gtk+-3.0 >= \$gtk_req enchant-2 >= \$enchant_req icu-uc\""; } >&5
($PKG_CONFIG --exists --print-errors "glib-2.0 >= $glib_req gtk+-3.0 >= $gtk_req enchant-2 >= $enchant_req icu-uc") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
pkg_cv_DEP_CFLAGS=`$PKG_CONFIG --cflags "glib-2.0 >= $glib_req gtk+-3.0 >= $gtk_req enchant-2 >= $enchant_req " 2>/dev/null`
pkg_cv_DEP_CFLAGS=`$PKG_CONFIG --cflags "glib-2.0 >= $glib_req gtk+-3.0 >= $gtk_req enchant-2 >= $enchant_req icu-uc" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes
else
pkg_failed=yes
......@@ -14559,12 +14559,12 @@ if test -n "$DEP_LIBS"; then
pkg_cv_DEP_LIBS="$DEP_LIBS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glib-2.0 >= \$glib_req gtk+-3.0 >= \$gtk_req enchant-2 >= \$enchant_req \""; } >&5
($PKG_CONFIG --exists --print-errors "glib-2.0 >= $glib_req gtk+-3.0 >= $gtk_req enchant-2 >= $enchant_req ") 2>&5
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glib-2.0 >= \$glib_req gtk+-3.0 >= \$gtk_req enchant-2 >= \$enchant_req icu-uc\""; } >&5
($PKG_CONFIG --exists --print-errors "glib-2.0 >= $glib_req gtk+-3.0 >= $gtk_req enchant-2 >= $enchant_req icu-uc") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
pkg_cv_DEP_LIBS=`$PKG_CONFIG --libs "glib-2.0 >= $glib_req gtk+-3.0 >= $gtk_req enchant-2 >= $enchant_req " 2>/dev/null`
pkg_cv_DEP_LIBS=`$PKG_CONFIG --libs "glib-2.0 >= $glib_req gtk+-3.0 >= $gtk_req enchant-2 >= $enchant_req icu-uc" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes
else
pkg_failed=yes
......@@ -14585,14 +14585,14 @@ else
_pkg_short_errors_supported=no
fi
if test $_pkg_short_errors_supported = yes; then
DEP_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "glib-2.0 >= $glib_req gtk+-3.0 >= $gtk_req enchant-2 >= $enchant_req " 2>&1`
DEP_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "glib-2.0 >= $glib_req gtk+-3.0 >= $gtk_req enchant-2 >= $enchant_req icu-uc" 2>&1`
else
DEP_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "glib-2.0 >= $glib_req gtk+-3.0 >= $gtk_req enchant-2 >= $enchant_req " 2>&1`
DEP_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "glib-2.0 >= $glib_req gtk+-3.0 >= $gtk_req enchant-2 >= $enchant_req icu-uc" 2>&1`
fi
# Put the nasty error message in config.log where it belongs
echo "$DEP_PKG_ERRORS" >&5
 
as_fn_error $? "Package requirements (glib-2.0 >= $glib_req gtk+-3.0 >= $gtk_req enchant-2 >= $enchant_req ) were not met:
as_fn_error $? "Package requirements (glib-2.0 >= $glib_req gtk+-3.0 >= $gtk_req enchant-2 >= $enchant_req icu-uc) were not met:
 
$DEP_PKG_ERRORS
 
......@@ -14630,44 +14630,6 @@ fi
 
 
 
# iso-codes
if test -n "$PKG_CONFIG" && \
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"iso-codes\""; } >&5
($PKG_CONFIG --exists --print-errors "iso-codes") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
have_iso_codes=yes
else
have_iso_codes=no
fi
if test "x$have_iso_codes" = "xyes"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether iso-codes has iso-639 and iso-3166 domains" >&5
$as_echo_n "checking whether iso-codes has iso-639 and iso-3166 domains... " >&6; }
if $PKG_CONFIG --variable=domains iso-codes | grep 639 > /dev/null && \
$PKG_CONFIG --variable=domains iso-codes | grep 3166 > /dev/null ; then
result=yes
else
result=no
have_iso_codes=no
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $result" >&5
$as_echo "$result" >&6; }
fi
if test "x$have_iso_codes" = "xyes"; then
cat >>confdefs.h <<_ACEOF
#define ISO_CODES_PREFIX "`$PKG_CONFIG --variable=prefix iso-codes`"
_ACEOF
else
as_fn_error $? "iso-codes is required." "$LINENO" 5
fi
# i18n
 
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether NLS is requested" >&5
......@@ -19611,7 +19573,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by gspell $as_me 1.8.4, which was
This file was extended by gspell $as_me 1.9.1, which was
generated by GNU Autoconf 2.69. Invocation command line was
 
CONFIG_FILES = $CONFIG_FILES
......@@ -19678,7 +19640,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
gspell config.status 1.8.4
gspell config.status 1.9.1
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
 
......
......@@ -3,7 +3,7 @@ dnl Process this file with autoconf to produce a configure script.
AC_PREREQ(2.64)
# Package version of the form 'major.minor.micro'.
m4_define(gspell_package_version, 1.8.4)
m4_define(gspell_package_version, 1.9.1)
AC_INIT([gspell],
[gspell_package_version],
......@@ -91,33 +91,7 @@ AX_COMPILER_FLAGS([WARN_CFLAGS], [WARN_LDFLAGS], [yes])
AX_REQUIRE_DEFINED([AX_PKG_CHECK_MODULES])
AX_PKG_CHECK_MODULES([DEP],
[glib-2.0 >= $glib_req gtk+-3.0 >= $gtk_req enchant-2 >= $enchant_req],
[])
# iso-codes
AX_REQUIRE_DEFINED([PKG_CHECK_EXISTS])
PKG_CHECK_EXISTS([iso-codes],
[have_iso_codes=yes],
[have_iso_codes=no])
if test "x$have_iso_codes" = "xyes"; then
AC_MSG_CHECKING([whether iso-codes has iso-639 and iso-3166 domains])
if $PKG_CONFIG --variable=domains iso-codes | grep 639 > /dev/null && \
$PKG_CONFIG --variable=domains iso-codes | grep 3166 > /dev/null ; then
result=yes
else
result=no
have_iso_codes=no
fi
AC_MSG_RESULT([$result])
fi
if test "x$have_iso_codes" = "xyes"; then
AC_DEFINE_UNQUOTED([ISO_CODES_PREFIX],
["`$PKG_CONFIG --variable=prefix iso-codes`"],
[ISO codes prefix])
else
AC_MSG_ERROR([iso-codes is required.])
fi
[icu-uc])
# i18n
AM_GNU_GETTEXT([external])
......
......@@ -36,7 +36,7 @@ IGNORE_HFILES = \
gspell-current-word-policy.h \
gspell-entry-private.h \
gspell-entry-utils.h \
gspell-init.h \
gspell-icu.h \
gspell-inline-checker-text-buffer.h \
gspell-osx.h \
gspell-text-iter.h \
......
......@@ -409,7 +409,7 @@ IGNORE_HFILES = \
gspell-current-word-policy.h \
gspell-entry-private.h \
gspell-entry-utils.h \
gspell-init.h \
gspell-icu.h \
gspell-inline-checker-text-buffer.h \
gspell-osx.h \
gspell-text-iter.h \
......
......@@ -14,7 +14,7 @@
<div class="titlepage">
<div>
<div><table class="navigation" id="top" width="100%" cellpadding="2" cellspacing="0"><tr><th valign="middle"><p class="title">gspell 1 Reference Manual</p></th></tr></table></div>
<div><p class="releaseinfo">for gspell 1.8.4</p></div>
<div><p class="releaseinfo">for gspell 1.9.1</p></div>
</div>
<hr>
</div>
......
......@@ -53,7 +53,7 @@ gspell_private_headers = \
gspell-current-word-policy.h \
gspell-entry-private.h \
gspell-entry-utils.h \
gspell-init.h \
gspell-icu.h \
gspell-inline-checker-text-buffer.h \
gspell-text-iter.h \
gspell-utils.h
......@@ -63,6 +63,7 @@ gspell_private_c_files = \
gspell-context-menu.c \
gspell-current-word-policy.c \
gspell-entry-utils.c \
gspell-icu.c \
gspell-init.c \
gspell-inline-checker-text-buffer.c \
gspell-text-iter.c \
......
......@@ -15,7 +15,7 @@
@SET_MAKE@
# aminclude_static.am generated automatically by Autoconf
# from AX_AM_MACROS_STATIC on Fri Sep 4 12:06:28 CEST 2020
# from AX_AM_MACROS_STATIC on Sat Oct 10 21:31:04 CEST 2020
......@@ -201,12 +201,12 @@ libgspell_@GSPELL_API_VERSION@_la_LINK = $(LIBTOOL) $(AM_V_lt) \
libgspell_core_la_DEPENDENCIES = $(am__DEPENDENCIES_1)
am__libgspell_core_la_SOURCES_DIST = gspellregion.c \
gspell-context-menu.c gspell-current-word-policy.c \
gspell-entry-utils.c gspell-init.c \
gspell-entry-utils.c gspell-icu.c gspell-init.c \
gspell-inline-checker-text-buffer.c gspell-text-iter.c \
gspell-utils.c gspell-osx.c gconstructor.h gspellregion.h \
gspell-checker-private.h gspell-context-menu.h \
gspell-current-word-policy.h gspell-entry-private.h \
gspell-entry-utils.h gspell-init.h \
gspell-entry-utils.h gspell-icu.h \
gspell-inline-checker-text-buffer.h gspell-text-iter.h \
gspell-utils.h gspell-osx.h gspell-checker.c \
gspell-checker-dialog.c gspell-entry.c gspell-entry-buffer.c \
......@@ -226,6 +226,7 @@ am__objects_2 = libgspell_core_la-gspellregion.lo \
libgspell_core_la-gspell-context-menu.lo \
libgspell_core_la-gspell-current-word-policy.lo \
libgspell_core_la-gspell-entry-utils.lo \
libgspell_core_la-gspell-icu.lo \
libgspell_core_la-gspell-init.lo \
libgspell_core_la-gspell-inline-checker-text-buffer.lo \
libgspell_core_la-gspell-text-iter.lo \
......@@ -280,6 +281,7 @@ am__depfiles_remade = \
./$(DEPDIR)/libgspell_core_la-gspell-entry-utils.Plo \
./$(DEPDIR)/libgspell_core_la-gspell-entry.Plo \
./$(DEPDIR)/libgspell_core_la-gspell-enum-types.Plo \
./$(DEPDIR)/libgspell_core_la-gspell-icu.Plo \
./$(DEPDIR)/libgspell_core_la-gspell-init.Plo \
./$(DEPDIR)/libgspell_core_la-gspell-inline-checker-text-buffer.Plo \
./$(DEPDIR)/libgspell_core_la-gspell-language-chooser-button.Plo \
......@@ -650,11 +652,11 @@ gspell_public_c_files = \
gspell_private_headers = gconstructor.h gspellregion.h \
gspell-checker-private.h gspell-context-menu.h \
gspell-current-word-policy.h gspell-entry-private.h \
gspell-entry-utils.h gspell-init.h \
gspell-entry-utils.h gspell-icu.h \
gspell-inline-checker-text-buffer.h gspell-text-iter.h \
gspell-utils.h $(am__append_3)
gspell_private_c_files = gspellregion.c gspell-context-menu.c \
gspell-current-word-policy.c gspell-entry-utils.c \
gspell-current-word-policy.c gspell-entry-utils.c gspell-icu.c \
gspell-init.c gspell-inline-checker-text-buffer.c \
gspell-text-iter.c gspell-utils.c $(am__append_4)
gspell_built_public_headers = \
......@@ -857,6 +859,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgspell_core_la-gspell-entry-utils.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgspell_core_la-gspell-entry.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgspell_core_la-gspell-enum-types.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgspell_core_la-gspell-icu.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgspell_core_la-gspell-init.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgspell_core_la-gspell-inline-checker-text-buffer.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgspell_core_la-gspell-language-chooser-button.Plo@am__quote@ # am--include-marker
......@@ -928,6 +931,13 @@ libgspell_core_la-gspell-entry-utils.lo: gspell-entry-utils.c
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgspell_core_la_CFLAGS) $(CFLAGS) -c -o libgspell_core_la-gspell-entry-utils.lo `test -f 'gspell-entry-utils.c' || echo '$(srcdir)/'`gspell-entry-utils.c
libgspell_core_la-gspell-icu.lo: gspell-icu.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgspell_core_la_CFLAGS) $(CFLAGS) -MT libgspell_core_la-gspell-icu.lo -MD -MP -MF $(DEPDIR)/libgspell_core_la-gspell-icu.Tpo -c -o libgspell_core_la-gspell-icu.lo `test -f 'gspell-icu.c' || echo '$(srcdir)/'`gspell-icu.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgspell_core_la-gspell-icu.Tpo $(DEPDIR)/libgspell_core_la-gspell-icu.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gspell-icu.c' object='libgspell_core_la-gspell-icu.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgspell_core_la_CFLAGS) $(CFLAGS) -c -o libgspell_core_la-gspell-icu.lo `test -f 'gspell-icu.c' || echo '$(srcdir)/'`gspell-icu.c
libgspell_core_la-gspell-init.lo: gspell-init.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgspell_core_la_CFLAGS) $(CFLAGS) -MT libgspell_core_la-gspell-init.lo -MD -MP -MF $(DEPDIR)/libgspell_core_la-gspell-init.Tpo -c -o libgspell_core_la-gspell-init.lo `test -f 'gspell-init.c' || echo '$(srcdir)/'`gspell-init.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgspell_core_la-gspell-init.Tpo $(DEPDIR)/libgspell_core_la-gspell-init.Plo
......@@ -1410,6 +1420,7 @@ distclean: distclean-recursive
-rm -f ./$(DEPDIR)/libgspell_core_la-gspell-entry-utils.Plo
-rm -f ./$(DEPDIR)/libgspell_core_la-gspell-entry.Plo
-rm -f ./$(DEPDIR)/libgspell_core_la-gspell-enum-types.Plo
-rm -f ./$(DEPDIR)/libgspell_core_la-gspell-icu.Plo
-rm -f ./$(DEPDIR)/libgspell_core_la-gspell-init.Plo
-rm -f ./$(DEPDIR)/libgspell_core_la-gspell-inline-checker-text-buffer.Plo
-rm -f ./$(DEPDIR)/libgspell_core_la-gspell-language-chooser-button.Plo
......@@ -1480,6 +1491,7 @@ maintainer-clean: maintainer-clean-recursive
-rm -f ./$(DEPDIR)/libgspell_core_la-gspell-entry-utils.Plo
-rm -f ./$(DEPDIR)/libgspell_core_la-gspell-entry.Plo
-rm -f ./$(DEPDIR)/libgspell_core_la-gspell-enum-types.Plo
-rm -f ./$(DEPDIR)/libgspell_core_la-gspell-icu.Plo
-rm -f ./$(DEPDIR)/libgspell_core_la-gspell-init.Plo
-rm -f ./$(DEPDIR)/libgspell_core_la-gspell-inline-checker-text-buffer.Plo
-rm -f ./$(DEPDIR)/libgspell_core_la-gspell-language-chooser-button.Plo
......
/*
* This file is part of gspell, a spell-checking library.
*
* Copyright 2020 - Sébastien Wilmet <swilmet@gnome.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
#include "gspell-icu.h"
#include <unicode/ustring.h>
#include <unicode/uloc.h>
/* Implementation notes:
*
* Before using the ICU library, the iso-codes package was used instead. It was
* fine on Linux since the iso-codes package is usually already installed. On
* MS Windows, to package an application the iso-codes package needed to be
* bundled with the app, which is not great because it's a quite sizeable dep.
*
* The ICU library is usually already installed too on Linux, and for Windows
* it's already an (indirect) dep of gedit (the Tepl library uses the ICU).
*
* MS Windows also provides a native API for something similar to
* _gspell_icu_get_language_name_from_code(). But it's easier to manage only one
* implementation (namely, based on the ICU library).
*/
/* Some of these functions are copied from the Tepl library. */
/* Wrapper around u_strToUTF8() that handles the pre-flighting.
*
* Returns: (transfer full) (nullable): the newly-allocated string with the
* right size. Free with g_free() when no longer needed.
*/
static char *
_gspell_icu_strToUTF8 (int32_t *pDestLength,
const UChar *src,
int32_t srcLength,
UErrorCode *pErrorCode)
{
int32_t my_DestLength = 0;
UErrorCode my_ErrorCode = U_ZERO_ERROR;
char *dest = NULL;
u_strToUTF8 (NULL, 0, &my_DestLength,
src, srcLength,
&my_ErrorCode);
if (my_ErrorCode != U_BUFFER_OVERFLOW_ERROR &&
my_ErrorCode != U_STRING_NOT_TERMINATED_WARNING)
{
if (pDestLength != NULL)
{
*pDestLength = my_DestLength;
}
if (pErrorCode != NULL)
{
*pErrorCode = my_ErrorCode;
}
return NULL;
}
dest = g_malloc0 (my_DestLength + 1);
u_strToUTF8 (dest, my_DestLength + 1, pDestLength,
src, srcLength,
pErrorCode);
return dest;
}
/* Returns: (transfer full) (nullable): a nul-terminated UTF-8 string. Free with
* g_free() when no longer needed.
*/
static char *
_gspell_icu_strToUTF8Simple (const UChar *uchars)
{
char *utf8_str;
UErrorCode error_code = U_ZERO_ERROR;
utf8_str = _gspell_icu_strToUTF8 (NULL, uchars, -1, &error_code);
if (U_FAILURE (error_code))
{
g_free (utf8_str);
return NULL;
}
return utf8_str;
}
/* Wrapper around uloc_getDisplayName() that handles the pre-flighting.
*
* Returns: (transfer full) (nullable): the result as a newly-allocated buffer
* with the right size. Free with g_free() when no longer needed.
*/
static UChar *
_gspell_icu_loc_getDisplayName (const char *localeID,
const char *inLocaleID,
UErrorCode *err)
{
UChar *result = NULL;
int32_t result_size;
UErrorCode my_err = U_ZERO_ERROR;
result_size = uloc_getDisplayName (localeID,
inLocaleID,
NULL, 0,
&my_err);
if (my_err != U_BUFFER_OVERFLOW_ERROR &&
my_err != U_STRING_NOT_TERMINATED_WARNING)
{
if (err != NULL)
{
*err = my_err;
}
return NULL;
}
result = g_new0 (UChar, result_size + 1);
uloc_getDisplayName (localeID,
inLocaleID,
result, result_size + 1,
err);
return result;
}
/* Returns: (transfer full) (nullable): the result as a UTF-8 string. Free with
* g_free() when no longer needed.
*/
char *
_gspell_icu_loc_getDisplayNameSimple (const char *localeID,
const char *inLocaleID)
{
UChar *result;
char *utf8_result;
UErrorCode err = U_ZERO_ERROR;
result = _gspell_icu_loc_getDisplayName (localeID, inLocaleID, &err);
if (U_FAILURE (err))
{
g_free (result);
return NULL;
}
utf8_result = _gspell_icu_strToUTF8Simple (result);
g_free (result);
return utf8_result;
}
/* Wrapper around uloc_canonicalize() that handles the pre-flighting.
*
* Returns: (transfer full) (nullable): the result as a newly-allocated buffer
* with the right size. Free with g_free() when no longer needed.
*/
static char *
_gspell_icu_loc_canonicalize (const char *localeID,
UErrorCode *err)
{
char *result = NULL;
int32_t result_size;
UErrorCode my_err = U_ZERO_ERROR;
result_size = uloc_canonicalize (localeID, NULL, 0, &my_err);
if (my_err != U_BUFFER_OVERFLOW_ERROR &&
my_err != U_STRING_NOT_TERMINATED_WARNING)
{
if (err != NULL)
{
*err = my_err;
}
return NULL;
}
result = g_new0 (char, result_size + 1);
uloc_canonicalize (localeID, result, result_size + 1, err);
return result;
}
/* Returns: (transfer full) (nullable): the result, or %NULL in case of error.
* Free with g_free() when no longer needed.
*/
static char *
_gspell_icu_loc_canonicalizeSimple (const char *localeID)
{
char *result;
UErrorCode err = U_ZERO_ERROR;
result = _gspell_icu_loc_canonicalize (localeID, &err);
if (U_FAILURE (err))
{
g_free (result);
return NULL;
}
return result;
}
/* The name of this function uses gspell's terminology:
* "Language code": as in gspell_language_get_code().
* "Language name": as in gspell_language_get_name(), except that the
* translation is controlled by the @inLocaleID parameter which has the same
* meaning as for _gspell_icu_loc_getDisplayNameSimple(). If @inLocaleID is
* %NULL then the default locale is used to translate the name. The @inLocaleID
* parameter is kept for this function for unit tests.
*
* Returns: (transfer full) (nullable): the language name, or %NULL in case of
* error. Free with g_free() when no longer needed.
*/
char *
_gspell_icu_get_language_name_from_code (const char *language_code,
const char *inLocaleID)
{
char *canonicalized_language_code;
char *language_name;
/* language_code can come from an outside/foreign source, so it's better
* to pass it through level 2 canonicalization.
*/
canonicalized_language_code = _gspell_icu_loc_canonicalizeSimple (language_code);
if (canonicalized_language_code == NULL)
{
return NULL;
}
language_name = _gspell_icu_loc_getDisplayNameSimple (canonicalized_language_code, inLocaleID);
g_free (canonicalized_language_code);
return language_name;
}
/*
* This file is part of gspell, a spell-checking library.
*
* Copyright 2016 - Ignacio Casal Quinteiro <icq@gnome.org>
* Copyright 2016 - Sébastien Wilmet <swilmet@gnome.org>
* Copyright 2020 - Sébastien Wilmet <swilmet@gnome.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
......@@ -18,20 +17,23 @@
* along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
#ifndef GSPELL_INIT_H
#define GSPELL_INIT_H
#ifndef GSPELL_ICU_H
#define GSPELL_ICU_H
#include <glib.h>
#ifdef G_OS_WIN32
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
G_BEGIN_DECLS
G_GNUC_INTERNAL
HMODULE _gspell_init_get_dll (void);
char * _gspell_icu_get_language_name_from_code (const char *language_code,
const char *inLocaleID);
#endif /* G_OS_WIN32 */
/* Intermediate functions, for unit tests: */
#endif /* GSPELL_INIT_H */
G_GNUC_INTERNAL
char * _gspell_icu_loc_getDisplayNameSimple (const char *localeID,
const char *inLocaleID);
G_END_DECLS
/* ex:set ts=8 noet: */
#endif /* GSPELL_ICU_H */
/*
* This file is part of gspell, a spell-checking library.
*
* Copyright 2015, 2016 - Sébastien Wilmet <swilmet@gnome.org>
* Copyright 2015, 2016, 2020 - Sébastien Wilmet <swilmet@gnome.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
......@@ -27,11 +27,12 @@
#include "config.h"
#endif
#include "gspell-init.h"
#include <glib/gi18n-lib.h>
#include "gconstructor.h"
#ifdef G_OS_WIN32
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
static HMODULE gspell_dll;
#endif
......@@ -149,12 +150,6 @@ DllMain (HINSTANCE hinstDLL,
return TRUE;
}
HMODULE
_gspell_init_get_dll (void)
{
return gspell_dll;
}
#elif defined (G_HAS_CONSTRUCTORS)
# ifdef G_DEFINE_CONSTRUCTOR_NEEDS_PRAGMA
......
......@@ -3,7 +3,7 @@
*
* Copyright 2006 - Paolo Maggi
* Copyright 2008 - Novell, Inc.
* Copyright 2015, 2016 - Sébastien Wilmet
* Copyright 2015, 2016, 2020 - Sébastien Wilmet
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
......@@ -27,7 +27,7 @@
#include <string.h>
#include <glib/gi18n-lib.h>
#include <enchant.h>
#include "gspell-init.h"
#include "gspell-icu.h"
#ifdef OS_OSX
#include "gspell-osx.h"
......@@ -43,9 +43,6 @@
* checking, i.e. a language for which a dictionary is installed.
*/
#define ISO_639_DOMAIN "iso_639"
#define ISO_3166_DOMAIN "iso_3166"
struct _GspellLanguage
{
gchar *code;
......@@ -53,268 +50,48 @@ struct _GspellLanguage
gchar *collate_key;
};
typedef struct _DictsData DictsData;
struct _DictsData
{
GHashTable *iso_639_table;
GHashTable *iso_3166_table;
GTree *tree;
};
G_DEFINE_BOXED_TYPE (GspellLanguage,
gspell_language,
gspell_language_copy,
gspell_language_free)
static gchar *
get_iso_codes_prefix (void)
{
gchar *prefix = NULL;
#ifdef G_OS_WIN32
HMODULE gspell_dll;
gspell_dll = _gspell_init_get_dll ();
prefix = g_win32_get_package_installation_directory_of_module ((gpointer) gspell_dll);
#endif
if (prefix == NULL)
{
prefix = g_strdup (ISO_CODES_PREFIX);
}
return prefix;
}
static gchar *
get_iso_codes_localedir (void)
{
gchar *prefix;
gchar *localedir;
prefix = get_iso_codes_prefix ();
localedir = g_build_filename (prefix, "share", "locale", NULL);
g_free (prefix);
return localedir;
}
static void
iso_639_start_element (GMarkupParseContext *context,
const gchar *element_name,
const gchar **attribute_names,
const gchar **attribute_values,
gpointer data,
GError **error)
{
GHashTable *hash_table = data;
const gchar *iso_639_1_code = NULL;
const gchar *iso_639_2_code = NULL;
const gchar *name = NULL;
const gchar *code = NULL;
gint i;
if (g_strcmp0 (element_name, "iso_639_entry") != 0)
{
return;
}
for (i = 0; attribute_names[i] != NULL; i++)
{
if (g_str_equal (attribute_names[i], "name"))
{
name = attribute_values[i];
}
else if (g_str_equal (attribute_names[i], "iso_639_1_code"))
{
iso_639_1_code = attribute_values[i];
}
else if (g_str_equal (attribute_names[i], "iso_639_2T_code"))
{
iso_639_2_code = attribute_values[i];
}
}
code = (iso_639_1_code != NULL) ? iso_639_1_code : iso_639_2_code;
if (code != NULL && code[0] != '\0' &&
name != NULL && name[0] != '\0')
{
g_hash_table_insert (hash_table,
g_strdup (code),
g_strdup (dgettext (ISO_639_DOMAIN, name)));
}
}
static void
iso_3166_start_element (GMarkupParseContext *context,
const gchar *element_name,
const gchar **attribute_names,
const gchar **attribute_values,
gpointer data,
GError **error)
{
GHashTable *hash_table = data;
const gchar *name = NULL;
const gchar *code = NULL;
gint i;
if (g_strcmp0 (element_name, "iso_3166_entry") != 0)
{
return;
}
for (i = 0; attribute_names[i] != NULL; i++)
{
if (g_str_equal (attribute_names[i], "name"))
{
name = attribute_values[i];
}
else if (g_str_equal (attribute_names[i], "alpha_2_code"))
{
code = attribute_values[i];
}
}
if (code != NULL && code[0] != '\0' &&
name != NULL && name[0] != '\0')
{
g_hash_table_insert (hash_table,
g_ascii_strdown (code, -1),
g_strdup (dgettext (ISO_3166_DOMAIN, name)));
}
}
static void
iso_codes_parse (const GMarkupParser *parser,
const gchar *basename,
GHashTable *hash_table)
{
GMappedFile *mapped_file;
gchar *prefix;
gchar *filename;
GError *error = NULL;
prefix = get_iso_codes_prefix ();
filename = g_build_filename (prefix,
"share",
"xml",
"iso-codes",
basename,
NULL);
g_free (prefix);
mapped_file = g_mapped_file_new (filename, FALSE, &error);
g_free (filename);
if (mapped_file != NULL)
{
GMarkupParseContext *context;
const gchar *contents;
gsize length;
context = g_markup_parse_context_new (parser, 0, hash_table, NULL);
contents = g_mapped_file_get_contents (mapped_file);
length = g_mapped_file_get_length (mapped_file);
g_markup_parse_context_parse (context, contents, length, &error);
g_markup_parse_context_free (context);
g_mapped_file_unref (mapped_file);
}
if (error != NULL)
{
g_warning ("%s: %s", basename, error->message);
g_clear_error (&error);
}
}
static void
spell_language_dict_describe_cb (const gchar * const language_code,
const gchar * const provider_name,
const gchar * const provider_desc,
const gchar * const provider_file,
DictsData *data)
gpointer user_data)
{
const gchar *iso_639_name;
const gchar *iso_3166_name;
gchar *language_name;
gchar *lowercase;
gchar **tokens;
/* Split language code into lowercase tokens. */
lowercase = g_ascii_strdown (language_code, -1);
tokens = g_strsplit (lowercase, "_", -1);
g_free (lowercase);
g_return_if_fail (tokens != NULL);
GList **available_languages = user_data;
GList *l;
GspellLanguage *language;
iso_639_name = g_hash_table_lookup (data->iso_639_table, tokens[0]);
g_return_if_fail (language_code != NULL);
if (iso_639_name == NULL)
for (l = *available_languages; l != NULL; l = l->next)
{
/* Translators: %s is the language ISO code. */
language_name = g_strdup_printf (C_("language", "Unknown (%s)"), language_code);
goto exit;
}
GspellLanguage *cur_language = l->data;
if (g_strv_length (tokens) < 2)
{
language_name = g_strdup (iso_639_name);
goto exit;
if (g_strcmp0 (cur_language->code, language_code) == 0)
{
/* Avoid duplicates. */
return;
}
}
iso_3166_name = g_hash_table_lookup (data->iso_3166_table, tokens[1]);
language = g_slice_new (GspellLanguage);
language->code = g_strdup (language_code);
if (iso_3166_name != NULL)
{
/* Translators: The first %s is the language name, and the
* second is the country name. Example: "French (France)".
*/
language_name = g_strdup_printf (C_("language", "%s (%s)"),
iso_639_name,
iso_3166_name);
}
else
language->name = _gspell_icu_get_language_name_from_code (language_code, NULL);
if (language->name == NULL)
{
/* Translators: The first %s is the language name, and the
* second is the country name. Example: "French (France)".
*/
language_name = g_strdup_printf (C_("language", "%s (%s)"),
iso_639_name,
tokens[1]);
/* Translators: %s is the language ISO code. */
language->name = g_strdup_printf (C_("language", "Unknown (%s)"), language_code);
}
exit:
g_strfreev (tokens);
language->collate_key = g_utf8_collate_key (language->name, -1);
g_tree_replace (data->tree, g_strdup (language_code), language_name);
}
static gboolean
spell_language_traverse_cb (const gchar *code,
const gchar *name,
GList **available_languages)
{
GspellLanguage *language;
language = g_slice_new (GspellLanguage);
language->code = g_strdup (code);
language->name = g_strdup (name);
language->collate_key = g_utf8_collate_key (name, -1);
*available_languages = g_list_insert_sorted (*available_languages,
language,
(GCompareFunc) gspell_language_compare);
return FALSE;
}
static gint
tree_compare_func (gconstpointer a,
gconstpointer b,
gpointer user_data)
{
return g_strcmp0 (a, b);
*available_languages = g_list_prepend (*available_languages, language);
}
/**
......@@ -328,21 +105,7 @@ gspell_language_get_available (void)
{
static gboolean initialized = FALSE;
static GList *available_languages = NULL;
gchar *localedir;
EnchantBroker *broker;
DictsData data;
GMarkupParser iso_639_parser =
{
iso_639_start_element,
NULL, NULL, NULL, NULL
};
GMarkupParser iso_3166_parser =
{
iso_3166_start_element,
NULL, NULL, NULL, NULL
};
if (initialized)
{
......@@ -351,47 +114,14 @@ gspell_language_get_available (void)
initialized = TRUE;
localedir = get_iso_codes_localedir ();
bindtextdomain (ISO_639_DOMAIN, localedir);
bind_textdomain_codeset (ISO_639_DOMAIN, "UTF-8");
bindtextdomain (ISO_3166_DOMAIN, localedir);
bind_textdomain_codeset (ISO_3166_DOMAIN, "UTF-8");
g_free (localedir);
data.iso_639_table = g_hash_table_new_full (g_str_hash,
g_str_equal,
(GDestroyNotify) g_free,
(GDestroyNotify) g_free);
data.iso_3166_table = g_hash_table_new_full (g_str_hash,
g_str_equal,
(GDestroyNotify) g_free,
(GDestroyNotify) g_free);
iso_codes_parse (&iso_639_parser, "iso_639.xml", data.iso_639_table);
iso_codes_parse (&iso_3166_parser, "iso_3166.xml", data.iso_3166_table);
data.tree = g_tree_new_full (tree_compare_func,
NULL,
(GDestroyNotify) g_free,
(GDestroyNotify) g_free);
broker = enchant_broker_init ();
enchant_broker_list_dicts (broker,
(EnchantDictDescribeFn) spell_language_dict_describe_cb,
&data);
spell_language_dict_describe_cb,
&available_languages);
enchant_broker_free (broker);
g_tree_foreach (data.tree,
(GTraverseFunc) spell_language_traverse_cb,
&available_languages);
g_hash_table_unref (data.iso_639_table);
g_hash_table_unref (data.iso_3166_table);
g_tree_unref (data.tree);
available_languages = g_list_sort (available_languages,
(GCompareFunc) gspell_language_compare);
return available_languages;
}
......
......@@ -6,6 +6,7 @@ gspell/gspell-current-word-policy.c
gspell/gspell-entry.c
gspell/gspell-entry-buffer.c
gspell/gspell-entry-utils.c
gspell/gspell-icu.c
gspell/gspell-inline-checker-text-buffer.c
gspell/gspell-language.c
gspell/gspell-language-chooser.c
......
No preview for this file type
......@@ -16,7 +16,7 @@ msgid ""
msgstr ""
"Project-Id-Version: gspell.HEAD\n"
"Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/gspell/issues\n"
"POT-Creation-Date: 2020-09-04 12:06+0200\n"
"POT-Creation-Date: 2020-10-10 21:30+0200\n"
"PO-Revision-Date: 2016-12-27 22:06+0200\n"
"Last-Translator: Khaled Hosny <khaledhosny@eglug.org>\n"
"Language-Team: Arabic <doc@arabeyes.org>\n"
......@@ -90,21 +90,12 @@ msgid "_Spelling Suggestions…"
msgstr "ا_قتراحات الإملاء…"
#. Translators: %s is the language ISO code.
#: gspell/gspell-language.c:256
#: gspell/gspell-language.c:89
#, c-format
msgctxt "language"
msgid "Unknown (%s)"
msgstr "مجهولة (%s)"
#. Translators: The first %s is the language name, and the
#. * second is the country name. Example: "French (France)".
#.
#: gspell/gspell-language.c:273 gspell/gspell-language.c:282
#, c-format
msgctxt "language"
msgid "%s (%s)"
msgstr "%s (%s)"
#: gspell/gspell-language-chooser-button.c:84
msgid "No language selected"
msgstr "لم تحدد أي لغة"
......@@ -181,6 +172,11 @@ msgstr "أ_لغِ"
msgid "_Select"
msgstr "ال_تحديد"
#, c-format
#~ msgctxt "language"
#~ msgid "%s (%s)"
#~ msgstr "%s (%s)"
#~ msgctxt "language"
#~ msgid "Default"
#~ msgstr "المبدئية"
......
No preview for this file type