Commit d45c5992 authored by Chris Allegretta's avatar Chris Allegretta
Browse files

Ken's ngettext fix

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1306 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
No related merge requests found
Showing with 10 additions and 2 deletions
+10 -2
...@@ -9,7 +9,8 @@ CVS code - ...@@ -9,7 +9,8 @@ CVS code -
- Disable VSTOP keystroke. Stops people accidentally locking up - Disable VSTOP keystroke. Stops people accidentally locking up
nano (suggested by David Benbennick). nano (suggested by David Benbennick).
- Pluralize messages with ngettext() where needed. (David - Pluralize messages with ngettext() where needed. (David
Benbennick) Benbennick) Tweaked to compile on systems lacking ngettext()
by DLR (problem found by Ken Tyler).
- Update nano.1 and nano.1.html to show that nano now does an - Update nano.1 and nano.1.html to show that nano now does an
emergency save on receiving SIGHUP or SIGTERM. (DLR) emergency save on receiving SIGHUP or SIGTERM. (DLR)
- Don't include "nowrap" in the long options if - Don't include "nowrap" in the long options if
......
...@@ -217,7 +217,11 @@ AC_MSG_WARN([*** Can not use slang when cross-compiling])), ...@@ -217,7 +217,11 @@ AC_MSG_WARN([*** Can not use slang when cross-compiling])),
esac], [AC_MSG_RESULT(no)]) esac], [AC_MSG_RESULT(no)])
dnl Checks for functions dnl Checks for functions
AC_CHECK_FUNCS(snprintf vsnprintf) AC_CHECK_FUNCS(ngettext snprintf vsnprintf)
if test "x$ac_cv_func_ngettext" = "xno"
then
AC_DEFINE(NO_NGETTEXT, 1, [Defined if ngettext() is unavailable])
fi
if test "x$ac_cv_func_snprintf" = "xno" -o "xac_cv_func_vsnprintf" = "xno" if test "x$ac_cv_func_snprintf" = "xno" -o "xac_cv_func_vsnprintf" = "xno"
then then
AM_PATH_GLIB(1.2.4,, AM_PATH_GLIB(1.2.4,,
......
...@@ -51,6 +51,9 @@ ...@@ -51,6 +51,9 @@
# include <libintl.h> # include <libintl.h>
# endif # endif
# define _(string) gettext(string) # define _(string) gettext(string)
# ifdef NO_NGETTEXT
# define ngettext(singular, plural, number) gettext(number == 1 ? singular : plural)
# endif
#else #else
# define _(string) (string) # define _(string) (string)
# define ngettext(singular, plural, number) number == 1 ? singular : plural # define ngettext(singular, plural, number) number == 1 ? singular : plural
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment