summaryrefslogtreecommitdiffstats
path: root/gl/gettext.h
diff options
context:
space:
mode:
Diffstat (limited to 'gl/gettext.h')
-rw-r--r--gl/gettext.h33
1 files changed, 17 insertions, 16 deletions
diff --git a/gl/gettext.h b/gl/gettext.h
index 8cf2dca..881ae33 100644
--- a/gl/gettext.h
+++ b/gl/gettext.h
@@ -1,5 +1,6 @@
1/* Convenience header for conditional use of GNU <libintl.h>. 1/* Convenience header for conditional use of GNU <libintl.h>.
2 Copyright (C) 1995-1998, 2000-2002, 2004-2006, 2009 Free Software Foundation, Inc. 2 Copyright (C) 1995-1998, 2000-2002, 2004-2006, 2009-2010 Free Software
3 Foundation, Inc.
3 4
4 This program is free software; you can redistribute it and/or modify 5 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
@@ -80,7 +81,7 @@
80 ((void) (Domainname), ngettext (Msgid1, Msgid2, N)) 81 ((void) (Domainname), ngettext (Msgid1, Msgid2, N))
81# undef dcngettext 82# undef dcngettext
82# define dcngettext(Domainname, Msgid1, Msgid2, N, Category) \ 83# define dcngettext(Domainname, Msgid1, Msgid2, N, Category) \
83 ((void) (Category), dngettext(Domainname, Msgid1, Msgid2, N)) 84 ((void) (Category), dngettext (Domainname, Msgid1, Msgid2, N))
84# undef textdomain 85# undef textdomain
85# define textdomain(Domainname) ((const char *) (Domainname)) 86# define textdomain(Domainname) ((const char *) (Domainname))
86# undef bindtextdomain 87# undef bindtextdomain
@@ -140,8 +141,8 @@ inline
140#endif 141#endif
141static const char * 142static const char *
142pgettext_aux (const char *domain, 143pgettext_aux (const char *domain,
143 const char *msg_ctxt_id, const char *msgid, 144 const char *msg_ctxt_id, const char *msgid,
144 int category) 145 int category)
145{ 146{
146 const char *translation = dcgettext (domain, msg_ctxt_id, category); 147 const char *translation = dcgettext (domain, msg_ctxt_id, category);
147 if (translation == msg_ctxt_id) 148 if (translation == msg_ctxt_id)
@@ -159,9 +160,9 @@ inline
159#endif 160#endif
160static const char * 161static const char *
161npgettext_aux (const char *domain, 162npgettext_aux (const char *domain,
162 const char *msg_ctxt_id, const char *msgid, 163 const char *msg_ctxt_id, const char *msgid,
163 const char *msgid_plural, unsigned long int n, 164 const char *msgid_plural, unsigned long int n,
164 int category) 165 int category)
165{ 166{
166 const char *translation = 167 const char *translation =
167 dcngettext (domain, msg_ctxt_id, msgid_plural, n, category); 168 dcngettext (domain, msg_ctxt_id, msgid_plural, n, category);
@@ -199,8 +200,8 @@ inline
199#endif 200#endif
200static const char * 201static const char *
201dcpgettext_expr (const char *domain, 202dcpgettext_expr (const char *domain,
202 const char *msgctxt, const char *msgid, 203 const char *msgctxt, const char *msgid,
203 int category) 204 int category)
204{ 205{
205 size_t msgctxt_len = strlen (msgctxt) + 1; 206 size_t msgctxt_len = strlen (msgctxt) + 1;
206 size_t msgid_len = strlen (msgid) + 1; 207 size_t msgid_len = strlen (msgid) + 1;
@@ -222,10 +223,10 @@ dcpgettext_expr (const char *domain,
222 translation = dcgettext (domain, msg_ctxt_id, category); 223 translation = dcgettext (domain, msg_ctxt_id, category);
223#if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS 224#if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
224 if (msg_ctxt_id != buf) 225 if (msg_ctxt_id != buf)
225 free (msg_ctxt_id); 226 free (msg_ctxt_id);
226#endif 227#endif
227 if (translation != msg_ctxt_id) 228 if (translation != msg_ctxt_id)
228 return translation; 229 return translation;
229 } 230 }
230 return msgid; 231 return msgid;
231} 232}
@@ -244,9 +245,9 @@ inline
244#endif 245#endif
245static const char * 246static const char *
246dcnpgettext_expr (const char *domain, 247dcnpgettext_expr (const char *domain,
247 const char *msgctxt, const char *msgid, 248 const char *msgctxt, const char *msgid,
248 const char *msgid_plural, unsigned long int n, 249 const char *msgid_plural, unsigned long int n,
249 int category) 250 int category)
250{ 251{
251 size_t msgctxt_len = strlen (msgctxt) + 1; 252 size_t msgctxt_len = strlen (msgctxt) + 1;
252 size_t msgid_len = strlen (msgid) + 1; 253 size_t msgid_len = strlen (msgid) + 1;
@@ -268,10 +269,10 @@ dcnpgettext_expr (const char *domain,
268 translation = dcngettext (domain, msg_ctxt_id, msgid_plural, n, category); 269 translation = dcngettext (domain, msg_ctxt_id, msgid_plural, n, category);
269#if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS 270#if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
270 if (msg_ctxt_id != buf) 271 if (msg_ctxt_id != buf)
271 free (msg_ctxt_id); 272 free (msg_ctxt_id);
272#endif 273#endif
273 if (!(translation == msg_ctxt_id || translation == msgid_plural)) 274 if (!(translation == msg_ctxt_id || translation == msgid_plural))
274 return translation; 275 return translation;
275 } 276 }
276 return (n == 1 ? msgid : msgid_plural); 277 return (n == 1 ? msgid : msgid_plural);
277} 278}