aboutsummaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
Diffstat (limited to 't')
-rw-r--r--t/01-basic.t18
-rw-r--r--t/langs/es_ES/LC_MESSAGES/test.mobin0 -> 456 bytes
2 files changed, 18 insertions, 0 deletions
diff --git a/t/01-basic.t b/t/01-basic.t
new file mode 100644
index 0000000..9fada2f
--- /dev/null
+++ b/t/01-basic.t
@@ -0,0 +1,18 @@
+use v6.c;
+use Test;
+use Gettext;
+
+constant spanish = 'es_ES.utf8';
+constant english = 'en_US.utf8';
+constant text-domain = 'test';
+
+ok bindtextdomain(text-domain, 't/langs/');
+ok textdomain(text-domain);
+
+setlocale(Gettext::LocaleCategory::LcAll, spanish);
+is _('Hello, world!'), 'Hola, mundo!';
+
+setlocale(Gettext::LocaleCategory::LcAll, english);
+is _('Hello, world!'), 'Hello, world!';
+
+done-testing;
diff --git a/t/langs/es_ES/LC_MESSAGES/test.mo b/t/langs/es_ES/LC_MESSAGES/test.mo
new file mode 100644
index 0000000..0f817fc
--- /dev/null
+++ b/t/langs/es_ES/LC_MESSAGES/test.mo
Binary files differ