在WordPress管理中翻译WPBakery

dy1byipe  于 2022-10-04  发布在  WordPress
关注(0)|答案(1)|浏览(187)

请原谅我,但我对编程还是个新手。我只需要一个词的翻译,希望不需要在我的网站上安装翻译插件。我已经使用以下css代码翻译了购物车页面上的单词“Shopping Cart”:

.woocommerce-cart .woocommerce > form > h1 {
    visibility: hidden;
    position: relative;

}
.woocommerce-cart .woocommerce > form > h1:after {
    visibility: visible;
    position: absolute;
    top: 0;
    left: 0;
    content: 'Handlekurv' !important;
}

但是,当我尝试在管理菜单中翻译WPBakery页面生成器时,什么也没有发生。我尝试了以下代码,但我认为类有问题:

.wp-has-submenu .wp-has-current-submenu .wp-menu-open .menu-top #toplevel_page_vc-general {
    visibility: hidden;
    position: relative;

}

.wp-has-submenu .wp-has-current-submenu .wp-menu-open .menu-top #toplevel_page_vc-general:after {
    visibility: visible;
    position: absolute;
    top: 0;
    left: 0;
    content: 'Page Builder' !important;
}
<li class="wp-has-submenu wp-not-current-submenu menu-top toplevel_page_vc-general" id="toplevel_page_vc-general"><a href="admin.php?page=vc-general" class="wp-has-submenu wp-not-current-submenu menu-top toplevel_page_vc-general" aria-haspopup="true"><div class="wp-menu-arrow"><div></div></div><div class="wp-menu-image dashicons-before" aria-hidden="true"><img src="https://hygg.no/wp-content/plugins/js_composer/assets/vc/logo/wpb-logo-white_32.svg" alt=""></div><div class="wp-menu-name">WPBakery Page Builder</div></a>
    <ul class="wp-submenu wp-submenu-wrap"><li class="wp-submenu-head" aria-hidden="true">WPBakery Page Builder</li><li class="wp-first-item"><a href="admin.php?page=vc-general" class="wp-first-item">General Settings</a></li><li><a href="admin.php?page=vc-roles">Role Manager</a></li><li><a href="admin.php?page=vc-updater">Product License</a></li><li><a href="admin.php?page=vc-welcome">About</a></li></ul></li>
<a href="admin.php?page=vc-general" class="wp-has-submenu wp-not-current-submenu menu-top toplevel_page_vc-general" aria-haspopup="true"><div class="wp-menu-arrow"><div></div></div><div class="wp-menu-image dashicons-before" aria-hidden="true"><img src="https://hygg.no/wp-content/plugins/js_composer/assets/vc/logo/wpb-logo-white_32.svg" alt=""></div><div class="wp-menu-name">WPBakery Page Builder</div></a>
<div class="wp-menu-arrow"><div></div></div>
<div class="wp-menu-image dashicons-before" aria-hidden="true"><img src="https://hygg.no/wp-content/plugins/js_composer/assets/vc/logo/wpb-logo-white_32.svg" alt=""></div>
<div class="wp-menu-name">WPBakery Page Builder</div>
<a href="admin.php?page=vc-general" class="wp-has-submenu wp-not-current-submenu menu-top toplevel_page_vc-general" aria-haspopup="true"><div class="wp-menu-arrow"><div></div></div><div class="wp-menu-image dashicons-before" aria-hidden="true"><img src="https://hygg.no/wp-content/plugins/js_composer/assets/vc/logo/wpb-logo-white_32.svg" alt=""></div><div class="wp-menu-name">WPBakery Page Builder</div></a>
<ul class="wp-submenu wp-submenu-wrap"><li class="wp-submenu-head" aria-hidden="true">WPBakery Page Builder</li><li class="wp-first-item"><a href="admin.php?page=vc-general" class="wp-first-item">General Settings</a></li><li><a href="admin.php?page=vc-roles">Role Manager</a></li><li><a href="admin.php?page=vc-updater">Product License</a></li><li><a href="admin.php?page=vc-welcome">About</a></li></ul>
nhaq1z21

nhaq1z211#

给出您的html代码,将此代码添加到您的CSS中将用Page Builder替换WPBakery Page Builder的所有示例。

.wp-menu-name, .wp-submenu-head{
    visibility: hidden;
    position: relative;
}

.wp-menu-name:after, .wp-submenu-head:after {
    visibility: visible;
    position: absolute;
    top: 0;
    left: 0;
    content: 'Page Builder' !important;
    }

尽管在整个页面/站点上没有更多的html上下文的情况下,一定要测试这一点,但它可能也会影响其他项目。

相关问题