<p>OK, so this isn't quite how i expected it to work, but it does so far. I won't post code, because you just need the right process:</p>

<p>Assuming you're creating tags for a dual locale site of English (en) and Spanish (es)</p>

<ol>
<li>Create a TagModel for first locale (en)</li>
<li>Set attributes and content for first en version</li>
<li>Save it</li>
<li><p>Load a new instance of a TagModel by <strong>loading the tag you just saved</strong> by id, but specify the <strong>other locale</strong>. </p>

<pre><code>$tag_es = craft()-&gt;tags-&gt;getTagById($tag_en-&gt;id, "es")
</code></pre></li>
<li><p>Assign the es title, content and attributes (regenerate the slug, too!)</p></li>
<li><p>Save the es tag with </p>

<pre><code>tags-&gt;saveTag($tag_es)
</code></pre></li>
</ol>

<p>Now, Tag Manager should keep them separated by locale, and you can query them by locale, too.</p>

<p>The bottom line is, you have to create alternate locale versions by essentially cloning the original Tag Model while specifying the new locale string, then reassign the content and just save it. Again, not what I expected.</p>

<p>EDIT: Check your results in the database. Don't believe the Tag Manager — it only shows data from one locale for some reason.</p>

CC BY-SA 3.0
2018-01-22T21:50:24.280Z
2018-01-22T22:23:50.320Z
2018-01-22T22:23:50.320Z
borducks
<p>I'm dealing with tag localization on an English/Spanish site and have figured out that if I create a new tag, both En and Es elements are created by default, which would be O.K. if I never had to filter tags for locale.</p>

<p>I discovered that if I <em>manually</em> delete the duplicate element from the other locale, they do only show in their respective locales, which is ideal for this. Is there a way to do this via the admin UI?</p>

<p>I have made the tags field on my entries non-translatable, but what would stop Craft from creating duplicate elements for the other locale?</p>

<p>EDIT: Also, if I update a tag, the other locale version that I deleted is <strong>recreated automatically</strong> :/</p>

<localization><tags>
Tag Localization: how to create a tag without translation fallback version?
# Tag Localization: how to create a tag without translation fallback version?

(Asked by: username_0 on 2018-01-22)

I'm dealing with tag localization on an English/Spanish site and have figured out that if I create a new tag, both En and Es elements are created by default, which would be O.K. if I never had to filter tags for locale.

I discovered that if I *manually* delete the duplicate element from the other locale, they do only show in their respective locales, which is ideal for this. Is there a way to do this via the admin UI?

I have made the tags field on my entries non-translatable, but what would stop Craft from creating duplicate elements for the other locale?

EDIT: Also, if I update a tag, the other locale version that I deleted is **recreated automatically** :/

**Tags:** localization, tags

---

## 1 answers

### Answer by username_0 on 2018-01-22. Score: 1

OK, so this isn't quite how i expected it to work, but it does so far. I won't post code, because you just need the right process:
Assuming you're creating tags for a dual locale site of English (en) and Spanish (es)

Create a TagModel for first locale (en)
Set attributes and content for first en version
Save it
Load a new instance of a TagModel by loading the tag you just saved by id, but specify the other locale. 
$tag_es = craft()->tags->getTagById($tag_en->id, "es")

Assign the es title, content and attributes (regenerate the slug, too!)
Save the es tag with 
tags->saveTag($tag_es)


Now, Tag Manager should keep them separated by locale, and you can query them by locale, too.
The bottom line is, you have to create alternate locale versions by essentially cloning the original Tag Model while specifying the new locale string, then reassign the content and just save it. Again, not what I expected.
EDIT: Check your results in the database. Don't believe the Tag Manager — it only shows data from one locale for some reason.


---

