答案1
负责带参数的完整命令行的变量是command_line
。要更改它,可以按照man pkexec
页面建议创建自定义策略。
但是,我最终编辑了 LC_MESSAGES。我的语言环境是 en_US,因此我执行了以下步骤:
- 复制
/usr/share/locale-langpack/en_GB/LC_MESSAGES/polkit-1.mo
- 解压它
msgunfmt polkit-1.mo -o polkit-1.po
- 編輯
polkit-1.po
msgid "Authentication is needed to run `$(program)' as the super user"
msgstr "Authentication is needed to run '$(program)' as the super user"
到
msgid "Authentication is needed to run `$(program)' as the super user"
msgstr "Authentication is needed to run '$(program)' ('$(command_line)') as the super user"
以及几条类似的线条。
- 打包回来
msgfmt polkit-1.po -o polkit-1.mo
- 把它放入
/usr/share/locale/en_US/LC_MESSAGES/polkit-1.mo
- 重新启动 polkit 守护进程
systemctl restart polkit