summaryrefslogtreecommitdiffstats
path: root/src/testdir/test_gettext_utf8.vim
blob: bb46ca0db37bf0a3c6ab1bfcde002094d62af35e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
source check.vim
" TODO: Why does this fail on MacOS 14 and Windows MSVC (Github CI)?
CheckNotMac
CheckNotMSWindows

" Test for gettext()
func Test_gettext()
  set encoding=utf-8
  call bindtextdomain("__PACKAGE__", getcwd())
  try
    language ru_RU
    call assert_equal('ОШИБКА: ', gettext("ERROR: ", "__PACKAGE__"))
  catch /^Vim\%((\a\+)\)\=:E197:/
    throw "Skipped: not possible to set locale to ru (missing?)"
  endtry
  try
    language en_GB.UTF-8
    call assert_equal('ERROR: ', gettext("ERROR: ", "__PACKAGE__"))
  catch /^Vim\%((\a\+)\)\=:E197:/
    throw "Skipped: not possible to set locale to en (missing?)"
  endtry
  set encoding&
endfunc

" vim: shiftwidth=2 sts=2 expandtab