<p>Correct, categories don’t have the same localization features that entries do, as it is expected that all categories will always live in all locales. And Craft doesn’t actually keep a record of which content has been directly translated, vs. which content was just copied over to a locale when one of the other locales was edited.</p>

<p>If you really want to only show the categories that have been translated, you’d have to add a custom “Translated” Lightswitch field to your category group’s field layout (which would be translatable so each locale gets its own value), and then factor it into any category queries:</p>

<pre><code>craft.categories.group('groupHandle').translated(1)
</code></pre>

CC BY-SA 3.0
2015-12-22T03:55:13.187Z
Thanks.  I ended up implementing this solution.  In this case, since all of the content is translated into every locale it works out. If different content was translated into each locale, I think things would get a little trickier as we'd start to add a new lightswitch for each locale, similar to the entries locale settings. The general assumption of all categories being translated is probably accurate, however in this case, it was a reasonable decision to not translate all content due to costs and the experience on the site improves if we are only displaying translated content.
Ben Parizek
CC BY-SA 3.0
2015-12-21T23:50:00.930Z
2015-12-21T23:50:00.930Z
Brandon Kelly
<p>I have a site for a company that is established in US markets and expanding into markets overseas.  The site has products and those products are grouped into categories.</p>

<p>Due to the costs of translating content, the client has opted to translate some of their product content but not all of it.  Out of 8 categories of products, only 2 of those categories have been translated.</p>

<pre><code>Category 1 =&gt; translated
Category 2
Category 3
Category 4
Category 5 =&gt; translated
Category 6
Category 7
Category 8
</code></pre>

<p>As far as I can tell, there is no way to output only a list of categories that have been translated in a specific locale. Unlike entries, Categories don't appear to have a way to be enabled or disabled - they are all active for all locales.</p>

<p>Am I missing anything?  Or has anybody come up with a way to display only translated categories?  Ideally, in the secondary locale, I would be able to display a list of only the two categories that have been translated:</p>

<pre><code>Category 1 =&gt; translated
Category 5 =&gt; translated
</code></pre>

<categories><localization>
How to only list translated categories?
# How to only list translated categories?

(Asked by: username_0 on 2015-12-21)

I have a site for a company that is established in US markets and expanding into markets overseas.  The site has products and those products are grouped into categories.
Due to the costs of translating content, the client has opted to translate some of their product content but not all of it.  Out of 8 categories of products, only 2 of those categories have been translated.
Category 1 => translated
Category 2
Category 3
Category 4
Category 5 => translated
Category 6
Category 7
Category 8

As far as I can tell, there is no way to output only a list of categories that have been translated in a specific locale. Unlike entries, Categories don't appear to have a way to be enabled or disabled - they are all active for all locales.
Am I missing anything?  Or has anybody come up with a way to display only translated categories?  Ideally, in the secondary locale, I would be able to display a list of only the two categories that have been translated:
Category 1 => translated
Category 5 => translated

**Tags:** categories, localization


---

## 1 answers

### Answer by username_1 on 2015-12-21. Score: 3 | Accepted answer

Correct, categories don’t have the same localization features that entries do, as it is expected that all categories will always live in all locales. And Craft doesn’t actually keep a record of which content has been directly translated, vs. which content was just copied over to a locale when one of the other locales was edited.
If you really want to only show the categories that have been translated, you’d have to add a custom “Translated” Lightswitch field to your category group’s field layout (which would be translatable so each locale gets its own value), and then factor it into any category queries:
craft.categories.group('groupHandle').translated(1)

> **Comments:**
> **username_0**: Thanks.  I ended up implementing this solution.  In this case, since all of the content is translated into every locale it works out. If different content was translated into each locale, I think things would get a little trickier as we'd start to add a new lightswitch for each locale, similar to the entries locale settings. The general assumption of all categories being translated is probably accurate, however in this case, it was a reasonable decision to not translate all content due to costs and the experience on the site improves if we are only displaying translated content.  

---

