我有一小段需要帮助的代码。我希望确保在我的法语网站上以法语显示这条加入运动行。现在,其他所有内容都在翻译中,但是我想知道可以添加什么代码来确保以其他语言显示?
<div class="hero-unit">
<div class="container">
<div class="row">
<div class="col-sm-12">
{% if hero_graphic or hero_text %}
<div class="hero-text">
{% if options.pledge_now_url %}
<div class="hero-pledge-button">
<a href="{{options.pledge_now_url}}" style="background-image: url('{{site.theme.link}}/assets/dist/img/arrow-right.png');font-size: 22px;">Join the Movement</a>
</div>
{% endif %}
{% if constant('ICL_LANGUAGE_CODE') == 'fr' %}
<style type='text/css'>@media (min-width: 769px) { .hero-unit .hero-text-plain { font-size: 60px; } .hero-unit .hero-text-formatted .line { font-size: 30px; }}</style>
{% endif %}
{% if hero_text and post.get_field('hero_text_smart_formatting') %}
<div class="hero-text-formatted">
{{ hero_text|smart_hero_formatting }}
</div>
{% elseif hero_graphic and hero_text %}
<img src="{{hero_graphic['url']}}" alt="{{hero_text}}" />
{% elseif hero_graphic %}
<img src="{{hero_graphic['url']}}" alt="{{hero_graphic["alt"]}}" />
{% elseif hero_text %}
<span class="hero-text-plain">{{hero_text}}</span>
{% endif %}
</div>
{% endif %}
</div>
</div>
</div>
</div>
答案 0 :(得分:0)
我不确定翻译是否正确,但据我了解您的问题,下面的修改应该可以解决此问题。
foreach ($arr as $field=>$data) {
$arr['filesize'] = readableBytes($array['filesize'])); // fix was put here
$page = str_ireplace("{$field}", $data, $page);
}