Php 在用';gettext';?
我想知道在使用php gettext函数回显字符串时是否有隐藏html标记的方法 这就是我得到的,我想在将html标记放入.po文件之前从字符串中去掉它们Php 在用';gettext';?,php,internationalization,translation,gettext,Php,Internationalization,Translation,Gettext,我想知道在使用php gettext函数回显字符串时是否有隐藏html标记的方法 这就是我得到的,我想在将html标记放入.po文件之前从字符串中去掉它们 <?=_('You must be logged in to add a link.<br /> If you already have a account, <a href="#" name="Log In">click here</a> to log in or <a href="#"
<?=_('You must be logged in to add a link.<br />
If you already have a account,
<a href="#" name="Log In">click here</a> to log in or
<a href="#" name="Register">join us</a> now!'); ?>
没有真正的方法隐藏它们,也无法在翻译后重新插入它们,您可以使用字符位置映射,但在翻译后,html标记的字符长度将发生变化 如果你绝对想避免使用html标签,你可以做的是保留中断,并将其转换为新行(如果Transalator需要的话),然后对html标签中的文本使用单独的翻译,例如
<?=_('You must be logged in to add a link.<br /> If you already have a account,') ?>
<a href="#" name="Log In"><?= _('click here') ?></a> <?= _('to log in or') ?>
);?> 没有真正的方法隐藏它们,也无法在翻译后重新插入它们,您可以使用字符位置映射,但在翻译后,html标记的字符长度将发生变化 如果你绝对想避免使用html标签,你可以做的是保留中断,并将其转换为新行(如果Transalator需要的话),然后对html标签中的文本使用单独的翻译,例如
<?=_('You must be logged in to add a link.<br /> If you already have a account,') ?>
<a href="#" name="Log In"><?= _('click here') ?></a> <?= _('to log in or') ?>
);?> 如果将html存储在变量中,并在必要时从变量中删除_tags(),则不起作用?如果将html存储在变量中,并在必要时从变量中删除_tags(),则不起作用?
<?=_('You must be logged in to add a link.<br /> If you already have a account,') ?>
<a href="#" name="Log In"><?= _('click here') ?></a> <?= _('to log in or') ?>