【发布时间】:2020-11-29 09:55:15
【问题描述】:
很好,我想翻译我的页脚,当用户更改我的 wordpress 的语言时,页脚以英语或西班牙语放置,文本被翻译,而不使用插件,那么我想知道如何翻译该文本字符串根据语言。
我使用 material-admin 主题来设计我的管理仪表板
admin-footer.php
*/
do_action( 'in_admin_footer' );
?>
<p id="footer-left" class="alignleft">
<?php
$text = __( 'Desarrollado por Solutto Labs - Contact Us <a href="%s">support@soluttoconsulting.com</a>' );
/**
* Filters the "Thank you" text displayed in the admin footer.
*
* @since 2.8.0
*
* @param string $text The content that will be printed.
*/
echo apply_filters( 'admin_footer_text', '<span id="footer-thankyou">' . $text . '</span>' );
?>
</p>
<p id="footer-upgrade" class="alignright">
<?php
/**
* Filters the version/update text displayed in the admin footer.
*
* WordPress prints the current version and update information,
* using core_update_footer() at priority 10.
*
* @since 2.3.0
*
* @see core_update_footer()
*
* @param string $content The content that will be printed.
*/
echo apply_filters( 'update_footer', '' );
?>
</p>
<div class="clear"></div>
</div>
mtrl-functions.php
//change admin footer text
function mtrl_footer_admin () {
/**
* Change footer
* @solutto
* by cesar
* Since 31-07-2020
*/
echo __( 'Desarrollado por Solutto Labs - Contactenos <a href="%s">support@soluttoconsulting.com</a>' );
}
【问题讨论】:
-
你刚刚定义了一个函数,但没有使用钩子来调用标签。
-
抱歉我不太明白
-
改变了我的页脚,但我希望它在用户改变语言时改变,它用西班牙语说什么,用英语说它
-
如果我是你,我会使用 LocoTranslate 但因为你不想要插件:wordpress.stackexchange.com/questions/288379/…
标签: php html wordpress custom-wordpress-pages