blob: 7862e39e04e9f8e38120af98326b31a9c172f292 [file] [log] [blame]
Christ van Willegence0ef912024-06-20 23:41:59 +02001source check.vim
RestorerZ96509102024-07-11 21:14:15 +02002" This fail on CI MacOS 14 because bindtextdomain() is not available there
3" (missing library?)
Christian Brabandt6bc11c02024-06-21 07:31:04 +02004CheckNotMac
Christ van Willegence0ef912024-06-20 23:41:59 +02005
6" Test for gettext()
7func Test_gettext()
8 set encoding=utf-8
9 call bindtextdomain("__PACKAGE__", getcwd())
10 try
RestorerZ96509102024-07-11 21:14:15 +020011 language messages ru_RU
Christ van Willegence0ef912024-06-20 23:41:59 +020012 call assert_equal('ОШИБКА: ', gettext("ERROR: ", "__PACKAGE__"))
13 catch /^Vim\%((\a\+)\)\=:E197:/
14 throw "Skipped: not possible to set locale to ru (missing?)"
15 endtry
16 try
RestorerZ96509102024-07-11 21:14:15 +020017 language messages en_GB.UTF-8
Christ van Willegence0ef912024-06-20 23:41:59 +020018 call assert_equal('ERROR: ', gettext("ERROR: ", "__PACKAGE__"))
19 catch /^Vim\%((\a\+)\)\=:E197:/
20 throw "Skipped: not possible to set locale to en (missing?)"
21 endtry
22 set encoding&
23endfunc
24
25" vim: shiftwidth=2 sts=2 expandtab