可能重复:
gettext 如何处理动态内容?
我正在使用 PHP 的 gettext。我想翻译一个包含变量的句子。这可能吗?
例如,在英语中:
Are you sure you want to block Alice?
(其中“Alice”是用户名。)
但是,在德语中,主语不会出现在句末。
Sind Sie sicher, dass Sie Alice blockieren?
在messages.po中,我有
msgid "BLOCK"
msgstr "Are you sure you want to block"
但我看不出有办法传递一个或多个变量。这可能吗?