<p>As pointed out in the comments to your question, there's no need
to specify the locale with your <code>relatedTo</code> parameter.</p>

<p>I already wrote you in response to your other question, Craft always works in one locale
only if you don't explicitly make it to do otherwise.</p>

<pre><code>{% for entry in entries %}

    &lt;h3&gt;{{ entry.title }}&lt;/h3&gt;

    {% for tag in craft.tags.relatedTo(entry) %}

        {{ loop.first ? '&lt;ul&gt;' }}
        &lt;li&gt;{{ tag.title }}&lt;/li&gt;
        {{ loop.last ? '&lt;/ul&gt;' }}

    {% else %}

        &lt;p&gt;No tags found&lt;/p&gt;

    {% endfor %}

{% endfor %}
</code></pre>

CC BY-SA 3.0
2015-02-23T15:34:36.540Z
I've used this code before, it worked until I've added first locale.
Dominik Krulak
CC BY-SA 3.0
2015-02-23T16:30:37.287Z
Can't have anything to do with adding a locale. You probably must have changed something else.
carlcs
CC BY-SA 3.0
2015-02-23T16:36:48.060Z
For sure. I'm on it now and I'm starting to discover, that It might cause the matrix field. I had tags in Assets field before I think. Could that be the problem?
Dominik Krulak
CC BY-SA 3.0
2015-02-23T16:44:18.577Z
I can't follow, Dominic. What matrix and or assets fields are you talking about? Please feel free to add a new question,  *"Display tag related to entry in current locale"* has nothing to do with all this and is answered in my opinion.
carlcs
CC BY-SA 3.0
2015-02-23T15:07:31.823Z
2015-02-23T15:07:31.823Z
carlcs
<p>I've got this code snippet I'm working with and I can't get tags pulled out for related entry in current locale. </p>

<p>Maybe worth to mention, that tags is matrix field.</p>

<pre><code>  {% set entries = craft.entries %}

  {% for entry in entries %}
  &lt;h3&gt;{{ entry.title }}&lt;/h3&gt;
  {% for tag in craft.tags.relatedTo({
          sourceElement: entries,
          sourceLocale: craft.locale
  }) %}
     &lt;li&gt;
     { tag.title }}
     &lt;/li&gt;
     {% else %}
     &lt;li&gt;
     No tags found
     &lt;/li&gt;
     {% endfor %}
     {% endfor %}
</code></pre>

CC BY-SA 3.0
2015-02-23T14:30:51.853Z
Why do you define the locale? Isn't this default behaviour?
KSPR
CC BY-SA 3.0
2015-02-23T14:59:18.700Z
At [link](http://buildwithcraft.com/docs/relations#the-relatedTo-param) under paragraph 'Getting more serious', it says, that 'you can set the 'sourceLocale' if you want to limit the scope to relations created from a particular field.'
Dominik Krulak
CC BY-SA 3.0
2015-02-23T15:09:26.630Z
Domini, could you please try posting your code snippets properly indented / formatted. Thanks!
carlcs
<localization><tag>
Display tag related to entry in current locale
# Display tag related to entry in current locale

(Asked by: username_0 on 2015-02-23)

I've got this code snippet I'm working with and I can't get tags pulled out for related entry in current locale. 
Maybe worth to mention, that tags is matrix field.
  {% set entries = craft.entries %}

  {% for entry in entries %}
  {{ entry.title }}
  {% for tag in craft.tags.relatedTo({
          sourceElement: entries,
          sourceLocale: craft.locale
  }) %}
     
     { tag.title }}
     
     {% else %}
     
     No tags found
     
     {% endfor %}
     {% endfor %}

**Tags:** localization, tag

> **Comments:**
> **username_1**: Why do you define the locale? Isn't this default behaviour?  
> **username_0**: At [link](http://buildwithcraft.com/docs/relations#the-relatedTo-param) under paragraph 'Getting more serious', it says, that 'you can set the 'sourceLocale' if you want to limit the scope to relations created from a particular field.'  
> **username_2**: Domini, could you please try posting your code snippets properly indented / formatted. Thanks!  

---

## 1 answers

### Answer by username_2 on 2015-02-23. Score: 2 | Accepted answer

As pointed out in the comments to your question, there's no need
to specify the locale with your relatedTo parameter.
I already wrote you in response to your other question, Craft always works in one locale
only if you don't explicitly make it to do otherwise.
{% for entry in entries %}

    {{ entry.title }}

    {% for tag in craft.tags.relatedTo(entry) %}

        {{ loop.first ? '' }}
        {{ tag.title }}
        {{ loop.last ? '' }}

    {% else %}

        No tags found

    {% endfor %}

{% endfor %}

> **Comments:**
> **username_0**: I've used this code before, it worked until I've added first locale.  
> **username_2**: Can't have anything to do with adding a locale. You probably must have changed something else.  
> **username_0**: For sure. I'm on it now and I'm starting to discover, that It might cause the matrix field. I had tags in Assets field before I think. Could that be the problem?  
> **username_2**: I can't follow, Dominic. What matrix and or assets fields are you talking about? Please feel free to add a new question,  *"Display tag related to entry in current locale"* has nothing to do with all this and is answered in my opinion.  

---

