summaryrefslogtreecommitdiffstats
path: root/src/testdir/test_gettext_utf8.vim
diff options
context:
space:
mode:
Diffstat (limited to 'src/testdir/test_gettext_utf8.vim')
-rw-r--r--src/testdir/test_gettext_utf8.vim22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/testdir/test_gettext_utf8.vim b/src/testdir/test_gettext_utf8.vim
new file mode 100644
index 0000000000..277710e14d
--- /dev/null
+++ b/src/testdir/test_gettext_utf8.vim
@@ -0,0 +1,22 @@
+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