summaryrefslogtreecommitdiffstats
path: root/gettext-tools/src/write-csharp.c
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2005-10-06 11:20:08 +0000
committerBruno Haible <bruno@clisp.org>2009-06-23 12:12:52 +0200
commitf1f805bcf63cd5073235be63957b064899427516 (patch)
tree1a66b301119e582f347450e57a8b40531996553d /gettext-tools/src/write-csharp.c
parent57424044ae0a92479daa4031fe01bc55a5afc5f8 (diff)
downloadexternal_gettext-f1f805bcf63cd5073235be63957b064899427516.zip
external_gettext-f1f805bcf63cd5073235be63957b064899427516.tar.gz
external_gettext-f1f805bcf63cd5073235be63957b064899427516.tar.bz2
Support for context dependent translations in PO files.
Diffstat (limited to 'gettext-tools/src/write-csharp.c')
-rw-r--r--gettext-tools/src/write-csharp.c24
1 files changed, 22 insertions, 2 deletions
diff --git a/gettext-tools/src/write-csharp.c b/gettext-tools/src/write-csharp.c
index 80143d8..611879b 100644
--- a/gettext-tools/src/write-csharp.c
+++ b/gettext-tools/src/write-csharp.c
@@ -85,8 +85,9 @@
#endif
#include "c-ctype.h"
-#include "error.h"
#include "relocatable.h"
+#include "error.h"
+#include "xerror.h"
#include "csharpcomp.h"
#include "message.h"
#include "mkdtemp.h"
@@ -562,7 +563,7 @@ write_csharp_code (FILE *stream, const char *class_name, message_list_ty *mlp)
struct expression *plural;
unsigned long int nplurals;
- header_entry = message_list_search (mlp, "");
+ header_entry = message_list_search (mlp, NULL, "");
extract_plural_expression (header_entry ? header_entry->msgstr : NULL,
&plural, &nplurals);
@@ -636,6 +637,25 @@ msgdomain_write_csharp (message_list_ty *mlp, const char *canon_encoding,
if (mlp->nitems == 0)
return 0;
+ /* Determine whether mlp has entries with context. */
+ {
+ bool has_context;
+ size_t j;
+
+ has_context = false;
+ for (j = 0; j < mlp->nitems; j++)
+ if (mlp->item[j]->msgctxt != NULL)
+ has_context = true;
+ if (has_context)
+ {
+ multiline_error (xstrdup (""),
+ xstrdup (_("\
+message catalog has context dependent translations\n\
+but the C# .dll format doesn't support contexts\n")));
+ return 1;
+ }
+ }
+
retval = 1;
/* Convert the messages to Unicode. */