runtime(typeset): enable localization for ConTeXt, METAFONT and MetaPost
Commit:
https://github.com/vim/vim/commit/f26a33d3a79b5e4db052ad3e125602c076937722
Author: Ivan Pešić <
27575106...@users.noreply.github.com>
Date: Thu Feb 19 17:53:18 2026 +0000
runtime(typeset): enable localization for ConTeXt, METAFONT and MetaPost
This will enable localization of the messages that are displayed
by the ConTeXt support script.
closes: #19176
Signed-off-by: Ivan Pešić <
27575106...@users.noreply.github.com>
Signed-off-by: Christian Brabandt <
c...@256bit.org>
diff --git a/runtime/autoload/typeset.vim b/runtime/autoload/typeset.vim
index aba847465..14bbcf03e 100644
--- a/runtime/autoload/typeset.vim
+++ b/runtime/autoload/typeset.vim
@@ -2,7 +2,7 @@ vim9script
# Language: Generic TeX typesetting engine
# Maintainer: Nicola Vitacolonna <
nvitac...@gmail.com>
-# Latest Revision: 2026 Feb 03
+# Latest Revision: 2026 Feb 19
# Constants and helpers {{{
const SLASH = !exists("+shellslash") || &shellslash ? '/' : '\'
@@ -15,15 +15,15 @@ def Echo(msg: string, mode: string, label: string)
echohl None
enddef
-def EchoMsg(msg: string, label = 'Notice')
+def EchoMsg(msg: string, label = gettext('Notice'))
Echo(msg, 'ModeMsg', label)
enddef
-def EchoWarn(msg: string, label = 'Warning')
+def EchoWarn(msg: string, label = gettext('Warning'))
Echo(msg, 'WarningMsg', label)
enddef
-def EchoErr(msg: string, label = 'Error')
+def EchoErr(msg: string, label = gettext('Error'))
Echo(msg, 'ErrorMsg', label)
enddef
# }}}
@@ -54,7 +54,7 @@ enddef
def ProcessOutput(qfid: number, wd: string, efm: string, ch: channel, msg: string)
# Make sure the quickfix list still exists
if getqflist({'id': qfid}).id != qfid
- EchoErr("Quickfix list not found, stopping the job")
+ EchoErr(gettext("Quickfix list not found, stopping the job"))
job_stop(ch_getjob(ch))
return
endif
@@ -74,13 +74,13 @@ def ExitCb(label: string, jobid: job, exitStatus: number)
if exitStatus == 0
botright cwindow
- EchoMsg('Success!', label)
+ EchoMsg(gettext('Success!'), label)
elseif exitStatus < 0
- EchoWarn('Job terminated', label)
+ EchoWarn(gettext('Job terminated'), label)
else
botright copen
wincmd p
- EchoWarn('There are errors.', label)
+ EchoWarn(gettext('There are errors.'), label)
endif
enddef
# }}}
@@ -208,12 +208,13 @@ export def Typeset(
var qfid = NewQuickfixList(fp)
if qfid == -1
- EchoErr('Could not create quickfix list', label)
+ EchoErr(gettext('Could not create quickfix list'), label)
return false
endif
if !filereadable(fp)
- EchoErr($'File not readable: {fp}', label)
+ var msg = gettext('File not readable:')
+ EchoErr($'{msg} {fp}', label)
return false
endif
@@ -231,19 +232,20 @@ export def Typeset(
})
if job_status(jobid) ==# "fail"
- EchoErr("Failed to start job", label)
+ EchoErr(gettext("Failed to start job"), label)
return false
endif
AddJob(label, jobid)
- EchoMsg('Typesetting...', label)
+ EchoMsg(gettext('Typesetting...'), label)
return true
enddef
export def JobStatus(label: string)
- EchoMsg($'Jobs still running: {len(GetRunningJobs(label))}', label)
+ var msg = gettext('Jobs still running:')
+ EchoMsg($'{msg} {len(GetRunningJobs(label))}', label)
enddef
export def StopJobs(label: string)
@@ -251,7 +253,7 @@ export def StopJobs(label: string)
job_stop(job)
endfor
- EchoMsg('Done.', label)
+ EchoMsg(gettext('Done.'), label)
enddef
# Typeset the specified buffer
@@ -269,12 +271,12 @@ export def TypesetBuffer(
name: string,
Cmd: func(string): list<string>,
env = {},
- label = 'Typeset'
+ label = gettext('Typeset')
): bool
var bufname = bufname(name)
if empty(bufname)
- EchoErr('Please save the buffer first.', label)
+ EchoErr(gettext('Please save the buffer first.'), label)
return false
endif
diff --git a/src/po/Make_all.mak b/src/po/Make_all.mak
index 2c91617f7..6d03846d6 100644
--- a/src/po/Make_all.mak
+++ b/src/po/Make_all.mak
@@ -194,10 +194,12 @@ CHECKFILES = \
PO_VIM_INPUTLIST = \
../../runtime/optwin.vim \
+ ../../runtime/autoload/typeset.vim \
../../runtime/defaults.vim
PO_VIM_JSLIST = \
optwin.js \
+ typeset.js \
defaults.js
# Arguments for xgettext to pick up messages to translate from the source code.
diff --git a/src/po/vim.pot b/src/po/vim.pot
index 6f5ee32cf..88bca4ef8 100644
--- a/src/po/vim.pot
+++ b/src/po/vim.pot
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Vim
"
"Report-Msgid-Bugs-To:
vim...@vim.org
"
-"POT-Creation-Date: 2026-01-06 14:41+0000
"
+"POT-Creation-Date: 2026-02-19 17:55+0000
"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE
"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>
"
"Language-Team: LANGUAGE <
L...@li.org>
"
@@ -10661,5 +10661,44 @@ msgstr ""
msgid "options for using tabpanel"
msgstr ""
+msgid "Notice"
+msgstr ""
+
+msgid "Quickfix list not found, stopping the job"
+msgstr ""
+
+msgid "Success!"
+msgstr ""
+
+msgid "Job terminated"
+msgstr ""
+
+msgid "There are errors."
+msgstr ""
+
+msgid "Could not create quickfix list"
+msgstr ""
+
+msgid "File not readable:"
+msgstr ""
+
+msgid "Failed to start job"
+msgstr ""
+
+msgid "Typesetting..."
+msgstr ""
+
+msgid "Jobs still running:"
+msgstr ""
+
+msgid "Done."
+msgstr ""
+
+msgid "Typeset"
+msgstr ""
+
+msgid "Please save the buffer first."
+msgstr ""
+
msgid "You discovered the command-line window! You can close it with \":q\"."
msgstr ""