如何从子主题footer.php文件生成新的.pot文件?

时间:2016-02-04 16:47:08

标签: php wordpress translate

我应该如何在我的新footer.php文件中为我的子主题编写文本元素,以便我可以提取字符串并将其翻译成西班牙语?请注意,我没有.php的经验。

以下是我要翻译的子主题footer.php文件中的部分:

<div class="row">
        <div class="fw-col-xs-12 fw-col-sm-15">
        <div class="row">
        <div class="fw-col-inner" style="padding: 0 15px;">
        <h6 style="text-align: left; text-transform:uppercase; color:#ffffff; padding-bottom:5px;">Our Mission</h6>
         <div class="footer-special-text">Barcelona Well Woman’s mission is to empower our clients to live a healthy and balanced life through personalized, natural and holistic treatments--resulting in a more joyous life.</div>
        </div>
         </div>
          </div>

         <div class="fw-col-xs-12 fw-col-sm-15">
        <div class="row">
        <div class="fw-col-inner" style="padding: 0 15px;">
        <h6 style="text-align: left; text-transform:uppercase; color:#ffffff; padding-bottom:5px;">Our Location</h6>
        <div class="services-list">
        <ul>
        <li><a href="http://test.bcnwellwoman.com/en/contact-page/"><i class="fa fa-map-marker" style="color:#FFBF5F;"></i> &nbsp; Barcelona, Spain Calle Casp 80, 1-3</a></div></li></ul>
        </div>
         </div>
          </div>

          <div class="fw-col-xs-12 fw-col-sm-15">
        <div class="row">
        <div class="fw-col-inner" style="padding: 0 15px;">
        <h6 style="text-align: left; text-transform:uppercase; color:#ffffff; padding-bottom:5px;">Contact Us</h6>
         <div class="services-list">
         <ul class="footer-content">
        <li><a href="http://test.bcnwellwoman.com/en/contact-page/"><i class="fa fa-phone" style="color:#FFBF5F;"></i> &nbsp; 622 720 499</a></li>
        <li><a href="mailto:info@bcnwellwoman.com"><i class="fa fa fa-envelope" style="color:#FFBF5F;"></i> &nbsp; info@bcnwellwoman.com</a></li>
        <li><a href="http://www.facebook.com/bcnwellwoman"><i class="fa fa-facebook" style="color:#FFBF5F;"></i> &nbsp; Like our page on Facebook</a></li>
        </ul>
        </div>
        </div>
         </div>
          </div>

           <div class="fw-col-xs-12 fw-col-sm-15">
        <div class="row">
        <div class="fw-col-inner" style="padding: 0 15px;">
        <h6 style="text-align: left; text-transform:uppercase; color:#ffffff; padding-bottom:5px;">Our Services & Therapies</h6>
         <div class="services-list">
         <ul>
        <li><a href="http://test.bcnwellwoman.com/en/services/acupuncture/">Acupuncture</a></li>
        <li><a href="http://test.bcnwellwoman.com/en/services/massage/">Massage</a></li>
        <li><a href="http://test.bcnwellwoman.com/en/services/natural-fertility/">Natural Fertility</a></li>
        <li><a href="http://test.bcnwellwoman.com/en/services/nutrition-naturopathy/">Nutrition & Naturopathy</a></li>
        <li><a href="http://test.bcnwellwoman.com/en/services/osteopathy/">Osteopathy</a></li>
        <li><a href="http://test.bcnwellwoman.com/en/services/physiotherapy/">Physiotherapy</a></li>
        <li><a href="http://test.bcnwellwoman.com/en/services/psychology-psychotherapy/">Psychology & Psychotherapy</a></li>
        <li><a href="http://test.bcnwellwoman.com/en/services/pilates/">Pilates</a></li>
        <li><a href="http://test.bcnwellwoman.com/en/services/yoga/">Yoga</a></li>


        </ul>
        </div>
        </div>
         </div>
          </div>


               <div class="fw-col-xs-12 fw-col-sm-15">
        <div class="row">
        <div class="fw-col-inner" style="padding: 0 15px;">
        <h6 style="text-align: left; text-transform:uppercase; color:#ffffff; padding-bottom:5px;">Language</h6>
         <div class="services-list">
         <ul>
        <li><a href="http://test.bcnwellwoman.com/en/">English</a></li>
        <li><a href="http://test.bcnwellwoman.com/es/inicio/">Español</a></li>


        </ul>
        </div>
        </div>
         </div>
          </div>



           </div>
           </div>



  <?php 

/ **结束自定义页脚* /

1 个答案:

答案 0 :(得分:0)

感谢您回复cale_b!我确实能够通过将以下代码添加到我需要翻译的每个列表项来翻译自定义页脚文本:但我感到很沮丧,因为我无法获得切换语言的链接。

例如,在网站的西班牙语版本/ es /当我点击页脚链接“Acupuntura”时,我将被带到该页面的英文版本。 (因为这是硬编码到页脚的内容?)我不知道如何获取用西班牙语更改页面的链接? 下面是footer.php代码的片段:

<div class="services-list"> <ul> <li><a href="http://test.bcnwellwoman.com/en/services/acupuncture/"><?php _e("Acupuncture", "wellnesscenter-child"); ?></a></li> <li><a href="http://test.bcnwellwoman.com/en/services/massage/"><?php _e("Massage", "wellnesscenter-child"); ?></a></li>