WordPress翻译占位符

WordPress翻译占位符,wordpress,translation,gettext,poedit,po,Wordpress,Translation,Gettext,Poedit,Po,所以,我想用POEDIT翻译WordPress主题和插件。 有些字符串使用占位符,如%s和%d,有人能告诉我它们的确切含义吗 因为,例如,我有“%d成人”和“%s成人”,但我不知道它们之间有什么区别这些占位符是的格式规范的一部分 $wpdb->prepare() supports a small subset of the sprintf() arguments. The %d is a placeholder for an integer (not a decimal,

所以,我想用POEDIT翻译WordPress主题和插件。 有些字符串使用占位符,如%s和%d,有人能告诉我它们的确切含义吗


因为,例如,我有“%d成人”和“%s成人”,但我不知道它们之间有什么区别

这些占位符是的格式规范的一部分

$wpdb->prepare() supports a small subset of the sprintf() arguments. 
        The %d is a placeholder for an integer (not a decimal, that would be %f).
        Use %d when you want to send a real integer to the database,
        Use %s for strings. 
简而言之,此函数先获取一个“格式字符串”,然后获取一系列值,并创建一个新字符串,将提供的值插入到格式字符串中:

$verse = sprintf('%d bottles of %s on the wall', 99, 'beer');
%d
占位符表示它是有符号十进制整数的位置。
%s
占位符表示它是字符串的一个点。

%d
=整数,
%s
=字符串-