$(POTFILE): $(ALL_TRANSLATABLE_FILES) Makefile
@$(MKDIR_P) po
- $(AM_V_GEN)$(XGETTEXT) $(XGETTEXT_OPTIONS) $(TRANSLATABLE_FILES) --language=C --keyword=_ --keyword=N_ -o $@,tmp
+ $(AM_V_GEN)$(XGETTEXT) $(XGETTEXT_OPTIONS) $(TRANSLATABLE_FILES) --language=C --keyword=_ --keyword=N_ --keyword=C_:1c,2 --keyword=NC_ -o $@,tmp
$(AM_V_at)test -z "$(UI_FILES)" || $(XGETTEXT) $(XGETTEXT_OPTIONS) -j $(UI_FILES) --language=Glade -o $@,tmp
$(AM_V_at)$(XGETTEXT) $(XGETTEXT_OPTIONS) -j doc/org.gnu.pspp.metainfo.xml.in -o $@,tmp
$(AM_V_at)$(XGETTEXT) $(XGETTEXT_OPTIONS) -j doc/org.gnu.pspp.desktop.in -o $@,tmp
#include "gettext.h"
#define N_(msgid) msgid
#define _(msgid) gettext (msgid)
+#define NC_(msgctxt,msgid) msgid
+#define C_(msgctxt,msgid) pgettext (msgctxt, msgid)
struct glm_spec
{
}
{
- int row = pivot_category_create_leaf (source->root,
- pivot_value_new_text (N_("Error")));
+ int row = pivot_category_create_leaf (
+ source->root,
+ pivot_value_new_text_translate ("Error", C_("statistics", "Error")));
const double df = n_total - df_corr;
const double ssq = gsl_vector_get (ws->ssq, 0);
const double mse = ssq / df;
struct pivot_value *
pivot_value_new_text (const char *text)
{
- char *c = xstrdup (text);
- char *local = xstrdup (gettext (c));
+ return pivot_value_new_text_translate (text, gettext (text));
+}
+
+/* Creates and returns new pivot_value whose original contents is
+ ORIG_TEXT and translated contents is TRANS_TEXT.
+ This function is for text strings that are part of the PSPP user
+ interface, such as names of procedures, statistics, annotations, error
+ messages, etc. For strings that come from the user, use
+ pivot_value_new_user_text(). */
+struct pivot_value *
+pivot_value_new_text_translate (const char* orig_text, const char *trans_text)
+{
+ char *c = xstrdup (orig_text);
+ char *local = xstrdup (trans_text);
struct pivot_value *value = xmalloc (sizeof *value);
*value = (struct pivot_value) {
/* Values from text strings. */
struct pivot_value *pivot_value_new_text (const char *);
+struct pivot_value *pivot_value_new_text_translate (const char *, const char *);
struct pivot_value *pivot_value_new_text_format (const char *, ...)
#if defined(__GNUC__) && ((__GNUC__ == 4 && __GNUC_MINOR__>= 4) || __GNUC__ > 4)
__attribute__((format(gnu_printf, 1, 2)));