1
0
forked from aniani/vim
Files
vim/src/testdir/test_gettext_utf8.vim
Christ van Willegen ce0ef910df patch 9.1.0509: not possible to translate Vim script messages
Problem:  not possible to translate Vim script messages
          (RestorerZ)
Solution: implement bindtextdomain() and gettext() to support Vim script
          message translations (Christ van Willegen)

fixes: #11637
closes: #12447

Signed-off-by: Christ van Willegen <cvwillegen@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-06-20 23:41:59 +02:00

23 lines
603 B
VimL

source check.vim
" 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