# Sprache im .tpl Template herausfinden

**URL:** <https://forum.shopware.com/t/sprache-im-tpl-template-herausfinden/12647>\
**Category:** Shopware 3.5\
**Tags:** general\
**Created:** [11. April 2013 um 16:31 UTC](https://forum.shopware.com/t/sprache-im-tpl-template-herausfinden/12647 "2013-04-11T16:31:25Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![fredz](https://avatars.discourse-cdn.com/v4/letter/f/977dab/32.png) [@fredz](https://forum.shopware.com/u/fredz)\
**Post date:** [11. April 2013 um 16:31 UTC](https://forum.shopware.com/t/sprache-im-tpl-template-herausfinden/12647/1 "2013-04-11T16:31:25Z")

</div>

Wie kann Ich in eine .tpl die aktuelle Sprache der Webseite herausfinden? {if $sLanguage.isocode eq “DE”} {if $sLanguage eq “DE”} {if $sLanguage.isocode eq 1} Gehen alle nicht. Und wie schreibe Ich die Variabele $sLanguage.isocode (oder eine andere richtige Variabele) im Datei (für test Zwecke, wie echo in PHP)?

---

<div class="post-metadata">

**Author:** ![ratzinger](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/ratzinger/32/15949_2.png) [@ratzinger](https://forum.shopware.com/u/ratzinger)\
**Post date:** [12. April 2013 um 08:56 UTC](https://forum.shopware.com/t/sprache-im-tpl-template-herausfinden/12647/2 "2013-04-12T08:56:32Z")

</div>

hallo, im shopware template system wird smarty verwendet. [http://www.smarty.net/docsv2/de/](http://www.smarty.net/docsv2/de/) um eine variable auszugeben einfach folgendes schreiben: `{$sLanguage.isocode}` allerdings muss nicht jedevariable auch an jeder stelle verfügbar sein!

---

<div class="post-metadata">

**Author:** ![fredz](https://avatars.discourse-cdn.com/v4/letter/f/977dab/32.png) [@fredz](https://forum.shopware.com/u/fredz)\
**Post date:** [12. April 2013 um 09:00 UTC](https://forum.shopware.com/t/sprache-im-tpl-template-herausfinden/12647/3 "2013-04-12T09:00:20Z")

</div>

Vielen dank, aber ist sLanguage.isocode die richtige Variabele um die aktuelle Sprache des Shops zu finden?

---

<div class="post-metadata">

**Author:** ![Maybach](https://avatars.discourse-cdn.com/v4/letter/m/e47c2d/32.png) [@Maybach](https://forum.shopware.com/u/Maybach)\
**Post date:** [8. Mai 2013 um 21:06 UTC](https://forum.shopware.com/t/sprache-im-tpl-template-herausfinden/12647/4 "2013-05-08T21:06:40Z")

</div>

[quote=„fredz“]Vielen dank, aber ist sLanguage.isocode die richtige Variabele um die aktuelle Sprache des Shops zu finden?[/quote] Ich habe es mit `{if $Shop-\>getLocale()-\>toString() == "de\_DE"}` gelöst um abzufragen ob der es die deutsche Webseite ist. Also scheint `$Shop-\>getLocale()-\>toString()` deine gesuchte „Variable“ zu sein.

---

<div class="post-metadata">

**Author:** ![hth](https://avatars.discourse-cdn.com/v4/letter/h/b77776/32.png) [@hth](https://forum.shopware.com/u/hth)\
**Post date:** [9. Mai 2013 um 10:53 UTC](https://forum.shopware.com/t/sprache-im-tpl-template-herausfinden/12647/5 "2013-05-09T10:53:43Z")

</div>

$Locale ist die Variable. Bei Sprachensubshops wird der Link auf das Formular auf der Artikeldetailseite nicht richtig gesetzt. Vorläufige Lösung für einen Deutsch/Englisch Shop: [administration-f55/anfrage-formular-t12866.html?hilit=locale#p59997](http://forum.shopware.de/administration-f55/anfrage-formular-t12866.html?hilit=locale#p59997) [code]{extends file=‚parent:frontend/detail/actions.tpl‘} {block name=‚frontend\_detail\_actions\_contact‘}

- {if $Locale!=„de\_DE“} [{se name=„DetailLinkContact“}{/se}](https://forum.shopware.com/support/index/sFid/21/sInquiry/detail/sOrdernumber/%7B%24sArticle.ordernumber%7D "{s name='DetailLinkContact'}{/s}") {else} {se name=„DetailLinkContact“}{/se} {/if}  
{/block}[/code]
