aboutsummaryrefslogtreecommitdiff
path: root/test cases
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2013-09-11 23:21:36 +0300
committerJussi Pakkanen <jpakkane@gmail.com>2013-09-11 23:21:36 +0300
commit409958feaa842972eefd261b2fa1182c13657be6 (patch)
tree0d714f0ef08287a0071a6ce46967836d1b07834e /test cases
parent2fe88bebd89b95272f753477831cf2c6b9172516 (diff)
downloadmeson-409958feaa842972eefd261b2fa1182c13657be6.zip
meson-409958feaa842972eefd261b2fa1182c13657be6.tar.gz
meson-409958feaa842972eefd261b2fa1182c13657be6.tar.bz2
Basic test case for gettext.
Diffstat (limited to 'test cases')
-rw-r--r--test cases/frameworks/6 gettext/po/meson.build0
-rw-r--r--test cases/frameworks/6 gettext/src/intlmain.c19
-rw-r--r--test cases/frameworks/6 gettext/src/meson.build1
3 files changed, 20 insertions, 0 deletions
diff --git a/test cases/frameworks/6 gettext/po/meson.build b/test cases/frameworks/6 gettext/po/meson.build
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/test cases/frameworks/6 gettext/po/meson.build
diff --git a/test cases/frameworks/6 gettext/src/intlmain.c b/test cases/frameworks/6 gettext/src/intlmain.c
new file mode 100644
index 0000000..ba5011b
--- /dev/null
+++ b/test cases/frameworks/6 gettext/src/intlmain.c
@@ -0,0 +1,19 @@
+#include<libintl.h>
+#include<locale.h>
+#include<stdio.h>
+
+#define _(String) gettext (String)
+#define gettext_noop(String) String
+#define N_(String) gettext_noop (String)
+
+#define PACKAGE "intltest"
+// WRONG, but enough for this test.
+#define LOCALEDIR "/usr/share/locale"
+
+int main(int argc, char **argv) {
+ setlocale(LC_ALL, "");
+ bindtextdomain(PACKAGE, LOCALEDIR);
+ textdomain(PACKAGE);
+ printf("%s\n", _("International greeting."));
+ return 0;
+}
diff --git a/test cases/frameworks/6 gettext/src/meson.build b/test cases/frameworks/6 gettext/src/meson.build
new file mode 100644
index 0000000..c53f566
--- /dev/null
+++ b/test cases/frameworks/6 gettext/src/meson.build
@@ -0,0 +1 @@
+executable('intlprog', 'intlmain.c')