]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
runtime(tutor): fix language selection for zh
authorGalaxySnail <me@glxys.nl>
Tue, 26 Aug 2025 19:37:38 +0000 (21:37 +0200)
committerChristian Brabandt <cb@256bit.org>
Tue, 26 Aug 2025 19:37:38 +0000 (21:37 +0200)
fixes: #18123
related: #18124

Signed-off-by: GalaxySnail <me@glxys.nl>
Signed-off-by: Christian Brabandt <cb@256bit.org>
runtime/tutor/tutor.vim

index 3aa4c1e3ebeb6d0922c1d33cd8b6099b98f5d5df..4771f28752040a24e851cb1d1684d8d3e14c6f81 100644 (file)
@@ -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