duangan6636 2014-03-13 03:23
浏览 42

q在PHP内部进行翻译

There are a few things that won't translate on my website that are inside PHP. Since it's inside PHP, the normal qTranslate quick tag won't work. Is there a simple code that could help me translate these words? Should it go on the same page where the translations are located?

This is the code for the what I need translated inside the PHP (Location:, Venue:, etc):

 <div class="event-text">
  <h2 class="event-title">' . get_the_title($post->ID) . '</h2>
    <ul class="event-meta">';
    if ($event_location != null) {
        echo '
      <li><span>Location:</span>' . $event_location . '</li>';
    }
    if ($club != null) {
        echo '
      <li><span>Venue:</span>' . $club . '</li>';
    }                   
    if ($event_allday == 'yes'){            
        echo '<li><span>Length:</span>All Day</li>';           
    } elseif ($tstart) {            
        echo '<li><span>Length:</span>' . $tstart . '';            
    } if ($tend) { 
        echo ' – ' . $tend . '</li>';
    }                
    echo '
      <li>';
    if (get_post_meta($post->ID, 'event_out', true) == 'yes') {
        echo '<div class="event-cancel-out"><p>Sold Out</p></div><!-- end .event-cancel-out -->';
    } elseif (get_post_meta($post->ID, 'event_cancel', true) == 'yes') {
        echo '<div class="event-cancel-out"><p>Canceled</p></div><!-- end .event-cancel-out -->';
    }elseif (get_post_meta($post->ID, 'event_free', true) == 'yes') { 
        echo '<div class="event-cancel-out"><p>Free Entry</p></div><!-- end #event-cancel-out -->';
    } else {
        echo '<div class="event-tickets"><a href="' . $event_ticket . '" >Buy Tickets</a></div><!-- end #event-tickets -->';
    }
    echo '</li>
    </ul><!-- end ul.event-meta -->';
    echo '
        ' . the_content() . '                                
</div><!-- end .event-text -->';
  • 写回答

1条回答 默认 最新

  • dptgpyl61857413 2014-03-14 02:24
    关注

    Yes, it is a theme file for Wordpress. I fixed these by changing to the following codes:

    echo __("<li><span><!--:en-->Location: <!--:--><!--:ja-->場所:<!--:--></span>") . $event_location . '</li>';
    
    echo '<div class="event-cancel-out"><p>' . __('<!--:en-->Sold Out<!--:--><!--:ja-->売り切れ<!--:-->') . '</p></div><!-- end .event-cancel-out -->';
    
    评论

报告相同问题?

悬赏问题

  • ¥20 我想使用一些网络协议或者部分协议也行,主要想实现类似于traceroute的一定步长内的路由拓扑功能
  • ¥30 深度学习,前后端连接
  • ¥15 孟德尔随机化结果不一致
  • ¥15 apm2.8飞控罗盘bad health,加速度计校准失败
  • ¥15 求解O-S方程的特征值问题给出边界层布拉休斯平行流的中性曲线
  • ¥15 谁有desed数据集呀
  • ¥20 手写数字识别运行c仿真时,程序报错错误代码sim211-100
  • ¥15 关于#hadoop#的问题
  • ¥15 (标签-Python|关键词-socket)
  • ¥15 keil里为什么main.c定义的函数在it.c调用不了