aboutsummaryrefslogtreecommitdiff
path: root/t/01-basic.t
blob: 9fada2f002443c052c3b2ff137da8c0a1a63bce6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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;