如何在wordpress中翻译静态文本

时间:2017-08-25 12:56:55

标签: wordpress multilingual polylang

我使用polylang插件使我的webiste多语言,并且某些文本/按钮文本无法翻译。

<div class="col-md-8 col-md-offset-2 text-center">
                <h1>Gwarancja przyjętych wartości</h1>
                    <h4 class="pl-20 pr-20 pv-20">Wieloletnie doświadczenie jak i relacje dealerskie gwarantują Najemcy konkurencyjne ceny i optymalny proces działania.</h4>
                    <div class="pv-30">
                        <a href="http://conspectusdelux.com/oferta" class="smooth-scroll scroll-spy btn btn-blue">Zobacz ofertę</a>
                    </div>

我在wordpress中有这个代码块并试图通过polylang插件翻译它。我安装了polylang字符串插件但是看不到它...我的问题是如何使用pll_register_string将其添加为字符串或如何翻译它以其他方式。我在Php上很穷,所以我为什么在这里问你们.. o建议或者代码示例,我可以自己使用和工作。

谢谢

1 个答案:

答案 0 :(得分:0)

我有类似的东西

<div class="row">
            <div class="col-md-8 col-md-offset-2 text-center">
                <h1><?php the_field('sekcja_w_stopce_-_tytul', 'option') ?></h1>
                    <h4 class="pl-20 pr-20 pv-20"><?php the_field('sekcja_w_stopce_-_tresc', 'option') ?></h4>
                    <div class="pv-30">
                        <a href="<?php echo get_home_url(); ?>/oferta" class="smooth-scroll scroll-spy btn btn-blue">Zobacz ofertę</a>
                    </div>
                    <div class="separator"></div>
                            <div>
                                <?php if( get_field('link_-_twitter', 'option') ) { ?>
                                    <div class="social-circle-border">
                                        <a href="<?php the_field('link_-_twitter', 'option')?>" target="_blank"><i class="fa fa-twitter social"></i></a> 
                                    </div>
                                <?php } if( get_field('link_-_facebook', 'option') ) { ?>
                                    <div class="social-circle-border">
                                        <a href="<?php the_field('link_-_facebook', 'option')?>" target="_blank"><i class="fa fa-facebook social"></i></a> 
                                    </div>
                                <?php } if( get_field('link_-_instagram', 'option') ) { ?>
                                    <div class="social-circle-border">
                                        <a href="<?php the_field('link_-_instagram', 'option')?>" target="_blank"><i class="fa fa-instagram social"></i></a> 
                                    </div>  
                                <?php } if( get_field('link_-_youtube', 'option') ) { ?>
                                    <div class="social-circle-border">
                                        <a href="<?php the_field('link_-_youtube', 'option')?>" target="_blank"><i class="fa fa-youtube social"></i></a> 
                                    </div>
                                <?php } ?>
                            </div>
                        </div>  
                    </div>

H1,H4就是这个我想做多语言