From: Ivan Pešić <27575106+eevan78@users.noreply.github.com> Date: Thu, 19 Feb 2026 17:53:18 +0000 (+0000) Subject: runtime(typeset): enable localization for ConTeXt, METAFONT and MetaPost X-Git-Tag: v9.2.0033~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f26a33d3a79b5e4db052ad3e125602c076937722;p=thirdparty%2Fvim.git 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+eevan78@users.noreply.github.com> Signed-off-by: Christian Brabandt --- diff --git a/runtime/autoload/typeset.vim b/runtime/autoload/typeset.vim index aba8474658..14bbcf03e2 100644 --- a/runtime/autoload/typeset.vim +++ b/runtime/autoload/typeset.vim @@ -2,7 +2,7 @@ vim9script # Language: Generic TeX typesetting engine # Maintainer: Nicola Vitacolonna -# 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, 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 2c91617f7f..6d03846d66 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 6f5ee32cfe..88bca4ef82 100644 --- a/src/po/vim.pot +++ b/src/po/vim.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Vim\n" "Report-Msgid-Bugs-To: vim-dev@vim.org\n" -"POT-Creation-Date: 2026-01-06 14:41+0000\n" +"POT-Creation-Date: 2026-02-19 17:55+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -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 ""