<p>This ended up being because not all categories were properly resaved after a new locale was added. Resaving the categories solved it.</p>

CC BY-SA 4.0
2018-08-06T08:23:27.193Z
Thanks for the help Brandon - I bless the day i started using craft cms even with the odd hiccup it beats every other cms i have used
joomkit
CC BY-SA 4.0
2018-12-27T03:06:33.223Z
I'm pretty sure this is a bug, yeah? Re-saving the categories fixed the problem for me too but it's pretty time consuming and I shouldn't have to do that in the first place.
kmgdev
CC BY-SA 4.0
2018-12-28T04:39:00.077Z
@kgrote a background task that resaves all categories is supposed to get queued up automatically after adding a locale.
Brandon Kelly
CC BY-SA 4.0
2018-08-04T16:51:47.463Z
2018-08-04T16:51:47.463Z
Brandon Kelly
<p>I have a craft2 site running quite happily with 8 languages.</p>

<p>I noticed recently that a dropdown selection of category entries is not working when the locale is changed to chinese (locale = 'zh').</p>

<p>So the list of countries to search on does not  render fully - only some countries are shown.</p>

<p>Here is the real world example
<a href="https://seafarerhelp.org/en/seafarers-directory" rel="nofollow noreferrer">https://seafarerhelp.org/en/seafarers-directory</a>
<a href="https://seafarerhelp.org/zh/seafarers-directory" rel="nofollow noreferrer">https://seafarerhelp.org/zh/seafarers-directory</a></p>

<p>check out the search country dropdown. It is using this template code:</p>

<pre><code>{% set countries = craft.categories({
    group: 'locations',
    limit: null,
    level: 1,
    order:['title asc']
   })
%}
</code></pre>

<p>In english we get the full list.
In Chinese (select the locale) we get only a handful.</p>

<p>Other countries seem fine. I am stumped. Have looked for oddities in structure but can find none. Ironically this area of the site is not translated but this doesn't present any problem with other locales/languages</p>

CC BY-SA 4.0
2018-07-24T05:23:55.480Z
Did you get this sorted? I’m seeing the same 9 locales on each of those links.
Brandon Kelly
CC BY-SA 4.0
2018-07-24T08:41:54.937Z
It's the country dropdown search box. So when you view in english and select the country to search the port directory, you get all countries. When you change to chinese, we get only 12 countries in the drop down search.
joomkit
CC BY-SA 4.0
2018-07-24T13:36:21.217Z
Ah gotcha. Have you verified that all of those entries are enabled for the ZH site? As a quick test you can add `localeEnabled: false` to your category criteria params.
Brandon Kelly
CC BY-SA 4.0
2018-07-24T16:03:34.703Z
I guess by enabled you mean the category entires settings are all available from translation? No content entries are pulled in the query. Added the param no difference....(Shame the Craft3 debugger isn't available - like that a lot). Kinda weird that all the other locales are ok. Content editor mistakenly added chinese to titles for some chinese entries but cant see why this would affect the categories....
joomkit
CC BY-SA 4.0
2018-07-24T22:26:26.120Z
Hm ok, not sure off the top of my head then. Can you email a database backup and a simple example template that illustrates the issue? support@craftcms.com
Brandon Kelly
<categories><localization>
Craft 2 categories locale issue
# Craft 2 categories locale issue

(Asked by: username_0 on 2018-07-23)

I have a craft2 site running quite happily with 8 languages.
I noticed recently that a dropdown selection of category entries is not working when the locale is changed to chinese (locale = 'zh').
So the list of countries to search on does not  render fully - only some countries are shown.
Here is the real world example
https://seafarerhelp.org/en/seafarers-directory
https://seafarerhelp.org/zh/seafarers-directory
check out the search country dropdown. It is using this template code:
{% set countries = craft.categories({
    group: 'locations',
    limit: null,
    level: 1,
    order:['title asc']
   })
%}

In english we get the full list.
In Chinese (select the locale) we get only a handful.
Other countries seem fine. I am stumped. Have looked for oddities in structure but can find none. Ironically this area of the site is not translated but this doesn't present any problem with other locales/languages

**Tags:** categories, localization

> **Comments:**
> **username_1**: Did you get this sorted? I’m seeing the same 9 locales on each of those links.  
> **username_0**: It's the country dropdown search box. So when you view in english and select the country to search the port directory, you get all countries. When you change to chinese, we get only 12 countries in the drop down search.  
> **username_1**: Ah gotcha. Have you verified that all of those entries are enabled for the ZH site? As a quick test you can add `localeEnabled: false` to your category criteria params.  
> **username_0**: I guess by enabled you mean the category entires settings are all available from translation? No content entries are pulled in the query. Added the param no difference....(Shame the Craft3 debugger isn't available - like that a lot). Kinda weird that all the other locales are ok. Content editor mistakenly added chinese to titles for some chinese entries but cant see why this would affect the categories....  
> **username_1**: Hm ok, not sure off the top of my head then. Can you email a database backup and a simple example template that illustrates the issue? support@craftcms.com  

---

## 1 answers

### Answer by username_1 on 2018-08-04. Score: 2 | Accepted answer

This ended up being because not all categories were properly resaved after a new locale was added. Resaving the categories solved it.

> **Comments:**
> **username_0**: Thanks for the help Brandon - I bless the day i started using craft cms even with the odd hiccup it beats every other cms i have used  
> **username_2**: I'm pretty sure this is a bug, yeah? Re-saving the categories fixed the problem for me too but it's pretty time consuming and I shouldn't have to do that in the first place.  
> **username_1**: @kgrote a background task that resaves all categories is supposed to get queued up automatically after adding a locale.  

---

