私はOpencart v2.3.0.2を使用しています。 一部のテキスト文字列を翻訳する方法のヘルプが必要です。フッターにopencartのテキスト文字列に翻訳を追加するには?
<ul class="static_links">
<li class="head-links">
<a href="<?php echo $about_products; ?>">
<?php echo $text_products; ?>
</a>
</li>
<li class="head-links">
<a href="<?php echo $contact; ?>">
<?php echo $text_novosti; ?>
</a>
</li>
<li class="head-links">
<a href="<?php echo $contact; ?>">
<?php echo $text_onas; ?>
</a>
</li>
</ul>
また、私が追加した新しい文字列と翻訳:私は、コードを使用して(/catalog/view/theme/mytheme/template/common/header.tplに)私のヘッダーメニューへのリンクを追加しました.php(/catalog/language/ru-ru/common/footer.php):
$_['text_products'] = 'О продуктах'; $_['$text_novosti'] = 'Новости'; $_['$text_onas'] = 'О нас';
最後に私が登録したそのheader.phpの(/catalog/controller/common/header.php)での翻訳:
//New links in menu
$data['text_products'] = $this->language->get('text_products');
$data['text_novosti'] = $this->language->get('text_novosti');
$data['text_onas'] = $this->language->get('text_onas');
結局、メニューでページを開くと$text_products
の翻訳文のみがあります。他の場所では値text_novosti
とtext_onas
のみが表示されます。しかし、代わりにfooter.phpの翻訳を表示する必要があります。
翻訳を正しく表示する方法を教えてください。
または、言語に基づいてテキストをハードコードする方法がありますか?
<?php if ($lang='en') {?> <a href="#">News</a><a href="#">About us</a>
<?php } ?>
НовостиОあなたはheader.tplであなたの文字列を使用したい場合は、あなたがあなたの文字列を追加する必要があります
おかげで、しかし間違いは$ _ [ 'text_products'] = 'Опродуктах' は、この文字列 'でした。 $ _ ['$ text_novosti'] = 'Новости'; $ _ ['$ text_onas'] = 'Онас'; '不要な' $ 'を配置しました。 –
こんにちは、あなたの歓迎 – DigitCart