]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
runtime(typeset): enable localization for ConTeXt, METAFONT and MetaPost
authorIvan Pešić <27575106+eevan78@users.noreply.github.com>
Thu, 19 Feb 2026 17:53:18 +0000 (17:53 +0000)
committerChristian Brabandt <cb@256bit.org>
Thu, 19 Feb 2026 17:55:29 +0000 (17:55 +0000)
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 <cb@256bit.org>
runtime/autoload/typeset.vim
src/po/Make_all.mak
src/po/vim.pot

index aba84746589517a997bcb1e2439a025724f1b749..14bbcf03e2fad4803709fa938191d875e1e6482a 100644 (file)
@@ -2,7 +2,7 @@ vim9script
 
 # Language:           Generic TeX typesetting engine
 # Maintainer:         Nicola Vitacolonna <nvitacolonna@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
 
index 2c91617f7fcdd4d39a297c28160051398a001d1f..6d03846d6690cd797fcce9a2d2176afb37407ba8 100644 (file)
@@ -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.
index 6f5ee32cfe2fa09c266e2322fd5769f214a23c39..88bca4ef827f7635219dce9fc10377a5e541eaaa 100644 (file)
@@ -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 <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\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 ""