diff options
author | Christ van Willegen <cvwillegen@gmail.com> | 2024-06-20 23:41:59 +0200 |
---|---|---|
committer | Christian Brabandt <cb@256bit.org> | 2024-06-20 23:41:59 +0200 |
commit | ce0ef910df837b9b961f007a0a35064cad85188b (patch) | |
tree | bd8b18ad704b6166904c78b706b1a4e359e3124b /src/testdir/test_gettext_cp1251.vim | |
parent | f7f8f0b76dc6a3bf5d51825db65245221e5d265e (diff) |
patch 9.1.0509: not possible to translate Vim script messagesv9.1.0509
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>
Diffstat (limited to 'src/testdir/test_gettext_cp1251.vim')
-rw-r--r-- | src/testdir/test_gettext_cp1251.vim | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/testdir/test_gettext_cp1251.vim b/src/testdir/test_gettext_cp1251.vim new file mode 100644 index 0000000000..fe02a03fc5 --- /dev/null +++ b/src/testdir/test_gettext_cp1251.vim @@ -0,0 +1,22 @@ +source check.vim + +" Test for gettext() +func Test_gettext() + set encoding=cp1251 + 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 |