-static const struct option lopts[] = {
- { "quiet", 0, NULL, 'q' },
- { "batch", 0, NULL, 'b' },
- { "interactive", 0, NULL, 'i' },
- { "file", 1, NULL, 'f' },
- { "execute", 1, NULL, 'e' },
- { "version", 0, NULL, 'V' },
- { "help", 0, NULL, 'H' },
- { 0 }
-};
+#define RAW_LOPTS \
+ { PN_("longopt", "quiet"), 0, NULL, 'q' }, \
+ { PN_("longopt", "batch"), 0, NULL, 'b' }, \
+ { PN_("longopt", "interactive"), 0, NULL, 'i' }, \
+ { PN_("longopt", "file"), 1, NULL, 'f' }, \
+ { PN_("longopt", "execute"), 1, NULL, 'e' }, \
+ { PN_("longopt", "version"), 0, NULL, 'V' }, \
+ { PN_("longopt", "help"), 0, NULL, 'H' }
+
+/*
+ * With NLS, we need a buffer big enough to store the translated options.
+ * The translations will be filled in at program startup.
+ */
+enum { NOPTS = sizeof (struct option[]){RAW_LOPTS} / sizeof (struct option) };
+static struct option lopts[NOPTS + !!ENABLE_NLS * NOPTS + 1] = { RAW_LOPTS };