latex2e
latex2e copied to clipboard
use \msg_module_name:n in ltkeys were appropriate
Brief outline of the enhancement
Currently messages e.g. about a load time option that is ignored use directly the family name. It would be nice if they would use \msg_module_name:n
to allow to translate internal module prefixes.
Minimal example showing the current behaviour
\begin{filecontents}[overwrite]{testnewkeys.sty}
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{testnewkeys}[%
2022/06/14
v1
test new key]
\ExplSyntaxOn
\prop_gput:Nnn \g_msg_module_name_prop { mypkg }{ testnewkeys }
%\msg_set:nnn
% { keys } { load-option-ignored }
% { Package~"\msg_module_name:n{#1}"~has~already~been~loaded:~ignoring~load-time~option~"#2".}
\DeclareKeys[mypkg]
{
,testload .tl_set:N = \testload
,testload .usage:n = load
}
\ExplSyntaxOff
\ProcessKeyOptions[mypkg]
\endinput
\end{filecontents}
\documentclass{article}
\usepackage[testload=a]{testnewkeys}
\usepackage[testload=b]{testnewkeys}
\begin{document}
abc
\end{document}
gives
LaTeX3 Warning: Package "mypkg" has already been loaded: ignoring load-time
(LaTeX3) option "testload".
If one uncomment the msg definition one get the wanted
LaTeX3 Warning: Package "testnewkeys" has already been loaded: ignoring
(LaTeX3) load-time option "testload".
This is controlled at the expl3
end
No this special message is in ltkeys.dtx:
\msg_new:nnn { keys } { load-option-ignored }
{ Package~"#1"~has~already~been~loaded:~ignoring~load-time~option~"#2". }
I've bounced it back :)
@u-fischer It's an easy fix: I guess if we see PL6 on the horizon I could do there ...
yes, fine (the message load-only
should be adapted too).