AS400-CRTCMD 本地化。是否可以在 运行 时间更改语言?

AS400-CRTCMD Localization. Is it possible to change language at run time?

我实际上正在将所有 DDS 文件转换为使用 MSGID 而不是纯文本。我现在可以更改应用程序的显示语言,只需使用法语、英语等 MSGF 选择正确的库...

但是对于命令,CRTCMD 似乎在编译时需要一个语言文件(使用 PMTFILE)并使用这些字符串来生成命令。我最终可以删除 MSGF,但该命令将显示文本。

我想要实现的是使用相同的 *CMD 对象并能够在 运行 时间需要时更改语言。

**编辑:假设当前支持的版本是 6.1 或更高版本...

我想你想在 CRTCMD PMTFILE() 参数上使用 *DYNAMIC

*DYNAMIC
When the command is prompted, prompt text messages
will be dynamically retrieved from the message file
specified for this parameter using the message
identifiers stored in the *CMD object when the command was created. The message identifier specified for the PROMPT or CHOICE parameter on a CMD, PARM, QUAL, or ELEM command definition statement must be found in the prompt text message file when the command is being prompted.

所以像

CRTCMD CMD(MYLIB/MYCMD) PGM(MYLIB/MYPGM) SRCFILE(MYLIB/QCMDSRC)
 SRCMBR(MYCMD) PMTFILE(*LIBL/MYMSGF *DYNAMIC)