runtime(tutor): fix language selection for zh
Commit:
https://github.com/vim/vim/commit/a0eb405761ecda8fae96a4904d37bb6eb1aa6b5e
Author: GalaxySnail <
m...@glxys.nl>
Date: Tue Aug 26 21:37:38 2025 +0200
runtime(tutor): fix language selection for zh
fixes:
https://github.com/vim/vim/issues/18123
related:
https://github.com/vim/vim/issues/18124
Signed-off-by: GalaxySnail <
m...@glxys.nl>
Signed-off-by: Christian Brabandt <
c...@256bit.org>
diff --git a/runtime/tutor/tutor.vim b/runtime/tutor/tutor.vim
index 3aa4c1e3e..4771f2875 100644
--- a/runtime/tutor/tutor.vim
+++ b/runtime/tutor/tutor.vim
@@ -65,6 +65,16 @@ if s:ext =~? '\.en'
let s:ext = ""
endif
+" Choose between Chinese (Simplified) and Chinese (Traditional)
+" based on the language, suggested by Alick Zhao.
+if s:ext =~? '\.zh'
+ if s:ext =~? 'zh_tw' || (exists("s:lang") && s:lang =~? 'zh_tw')
+ let s:ext = ".zh_tw"
+ else
+ let s:ext = ".zh_cn"
+ endif
+endif
+
" 2. Build the name of the file and chapter
let s:chapter = exists("$CHAPTER") ? $CHAPTER : 1