Answers.Body: <p>The solution that ended up working for me was to just turn off all default locales for the section in question.</p>
  
  <p>The problem was that if a locale is on by default, then it seems it's impossible to turn it off until you've filled in all the required fields. But if no locale is active by default, you can just create only the one(s) that you need, and you don't run into the problem of trying to deactivate any of the others (since their status is off by default).</p>
  
  <p>I'd thought that having a default locale would save admins time when posting, but actually with all locales off, no extra steps are added to the process of creating a post, and you actually <em>avoid</em> the step of (and potential problems with) turning off non-required locales.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-01-16T09:38:04.157Z
Answers.Text: Quick note for anyone looking for these settings. They are not in the config file, but in the admin.
Answers.UserDisplayName: Martin
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-11-03T11:49:57.563Z
Answers.LastActivityDate: 2014-11-03T11:49:57.563Z
Answers.UserDisplayName: Nick F
Answers.Body: <p>I don't know if you re-use the fields you're using in that channel in other sections and if you do, my suggestion might not work for you, but here's what you could do:</p>
  
  <p>Set all fields to be "not translatable" and if content is entered in one locale it will get synced to all locales. Thereby all required fields will always be filled out and disabling individual "dummy versions" is no problem any more.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-10-13T14:09:12.157Z
Answers.Text: Ah, unfortunately one of the fields does need to be translatable - it's a matrix field that's widely used across the site, including on pages where it needs to be fully replaceable on entries for different locales.
Answers.UserDisplayName: Nick F
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-10-13T14:45:40.950Z
Answers.Text: OK, but if that matrix field is the only field that is shared, you could set it to be not required.
Answers.UserDisplayName: carlcs
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-10-13T16:04:50.223Z
Answers.Text: But that's the exact problem I'm having: how to use it across locales while keeping it as required! (cf. last paragraph of my question)
Answers.UserDisplayName: Nick F
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-10-13T16:26:20.267Z
Answers.Text: Yeah I know, but I was thinking you could do an exception for that one matrix field ;)
Answers.UserDisplayName: carlcs
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-10-13T12:10:15.887Z
Answers.LastActivityDate: 2014-10-13T12:10:15.887Z
Answers.UserDisplayName: carlcs
Answers.Body: <p>Why don't you leave the entries enabled in all locales and just don't load them in the templates.</p>
  
  <pre><code>{% if craft.locale == 'fr' %}
      {% set entries = craft.entries.section('news-fr') %}
  {% elseif craft.locale == 'en' %}
      {% set entries = craft.entries.section('news-en') %}
  {% elseif craft.locale == 'de' %}
      {% set entries = craft.entries.section('news-de') %}
  {% endif %}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-10-13T14:12:34.783Z
Answers.Text: I'm not sure I quite follow this. Is there something special about the '-lang' suffix on a section? Or are you suggesting multiple channels? I'm keen to have them all in the same multilingual section if possible, because nowhere else on the site has different sections for different locales.
Answers.UserDisplayName: Nick F
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-10-13T14:40:22.443Z
Answers.Text: Yes, I actually thought that this is what you're doing, different channels for your locales. But yeah, if you have them all in one channel, then this doesn't work, of course. :D
Answers.UserDisplayName: carlcs
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-10-13T12:26:54.337Z
Answers.LastActivityDate: 2014-10-13T12:26:54.337Z
Answers.UserDisplayName: carlcs
Body: <p>I'm building a multi-lingual site and have found Craft's locales / translatable fields useful for setting up structures where each page will have a translated version. However, for at least one of the Channel sections it would make more sense to have separate entries for each locale, rather than having each entry being translatable and appearing in all locales.</p>
  
  <p>This seems doable by disabling all but one of the locales on each entry in the section, but the problem I'm having is that if an entry has required fields, I can't save it if these fields are empty, even if they're only empty in a locale that I'm trying to disable. (eg. I want to have a Spanish-only post, but when I try to disable the English version I can't save the post because the English version has required fields that aren't filled in...)</p>
  
  <p>It seems I either have to make my required fields non-required, or fill them with spurious stuff in the locale I want to disable. I'm sure there must be a way of making required fields work with multi-lingual posts, but I can't figure out quite how... I'd be grateful for any pointers here!</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2014-10-13T12:18:42.983Z
Comments.Text: Hmmm... I'd actually try and do a feature request to P&T and ask them if they could implement a setting to disable new entries in a section by default.
Comments.UserDisplayName: carlcs
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2014-10-13T14:07:48.533Z
Comments.Text: I think you can do this: in the section config page you can set default locales for new entries. I've currently set them to default to off for all locales, which partly solves my problem.
Comments.UserDisplayName: Nick F
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2014-10-13T14:35:12.720Z
Comments.Text: Oh that's good, I had no idea one can actually already do this. Why does this solve your problem only partly, what else is missing?
Comments.UserDisplayName: carlcs
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2014-10-13T16:08:17.047Z
Comments.Text: Basically, it seems to work ok with creating new posts (I can now create them with content only in one locale), but if I have an existing post in multiple locales, I can't disable a locale without having to fill in the required fields.
Comments.UserDisplayName: Nick F
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2014-10-13T16:25:16.210Z
Comments.Text: For existing ones you could do that in the DB or, if there aren't many, delete and create them from scratch. But good to hear that you found a solution, Nick!
Comments.UserDisplayName: carlcs
Tags: <localization><field><language><required>
Title: How to use required fields on localised entries?
ThreadText: # How to use required fields on localised entries?
  
  (Asked by: username_0 on 2014-10-13)
  
  I'm building a multi-lingual site and have found Craft's locales / translatable fields useful for setting up structures where each page will have a translated version. However, for at least one of the Channel sections it would make more sense to have separate entries for each locale, rather than having each entry being translatable and appearing in all locales.
  
  This seems doable by disabling all but one of the locales on each entry in the section, but the problem I'm having is that if an entry has required fields, I can't save it if these fields are empty, even if they're only empty in a locale that I'm trying to disable. (eg. I want to have a Spanish-only post, but when I try to disable the English version I can't save the post because the English version has required fields that aren't filled in...)
  
  It seems I either have to make my required fields non-required, or fill them with spurious stuff in the locale I want to disable. I'm sure there must be a way of making required fields work with multi-lingual posts, but I can't figure out quite how... I'd be grateful for any pointers here!
  
  **Tags:** localization, field, language, required
  
  > **Comments:**
  > **username_1**: Hmmm... I'd actually try and do a feature request to P&T and ask them if they could implement a setting to disable new entries in a section by default.  
  > **username_0**: I think you can do this: in the section config page you can set default locales for new entries. I've currently set them to default to off for all locales, which partly solves my problem.  
  > **username_1**: Oh that's good, I had no idea one can actually already do this. Why does this solve your problem only partly, what else is missing?  
  > **username_0**: Basically, it seems to work ok with creating new posts (I can now create them with content only in one locale), but if I have an existing post in multiple locales, I can't disable a locale without having to fill in the required fields.  
  > **username_1**: For existing ones you could do that in the DB or, if there aren't many, delete and create them from scratch. But good to hear that you found a solution, username_0!  
  
  ---
  
  ## 3 answers
  
  ### Answer by username_0 on 2014-11-03. Score: 0 | Accepted answer
  
  The solution that ended up working for me was to just turn off all default locales for the section in question.
  
  The problem was that if a locale is on by default, then it seems it's impossible to turn it off until you've filled in all the required fields. But if no locale is active by default, you can just create only the one(s) that you need, and you don't run into the problem of trying to deactivate any of the others (since their status is off by default).
  
  I'd thought that having a default locale would save admins time when posting, but actually with all locales off, no extra steps are added to the process of creating a post, and you actually *avoid* the step of (and potential problems with) turning off non-required locales.
  
  > **Comments:**
  > **username_2**: Quick note for anyone looking for these settings. They are not in the config file, but in the admin.  
  
  ---
  
  ### Answer by username_1 on 2014-10-13. Score: 2
  
  I don't know if you re-use the fields you're using in that channel in other sections and if you do, my suggestion might not work for you, but here's what you could do:
  
  Set all fields to be "not translatable" and if content is entered in one locale it will get synced to all locales. Thereby all required fields will always be filled out and disabling individual "dummy versions" is no problem any more.
  
  > **Comments:**
  > **username_0**: Ah, unfortunately one of the fields does need to be translatable - it's a matrix field that's widely used across the site, including on pages where it needs to be fully replaceable on entries for different locales.  
  > **username_1**: OK, but if that matrix field is the only field that is shared, you could set it to be not required.  
  > **username_0**: But that's the exact problem I'm having: how to use it across locales while keeping it as required! (cf. last paragraph of my question)  
  > **username_1**: Yeah I know, but I was thinking you could do an exception for that one matrix field ;)  
  
  ---
  
  ### Answer by username_1 on 2014-10-13. Score: 1
  
  Why don't you leave the entries enabled in all locales and just don't load them in the templates.
  
  ```
  {% if craft.locale == 'fr' %}
      {% set entries = craft.entries.section('news-fr') %}
  {% elseif craft.locale == 'en' %}
      {% set entries = craft.entries.section('news-en') %}
  {% elseif craft.locale == 'de' %}
      {% set entries = craft.entries.section('news-de') %}
  {% endif %}
  
  ```
  
  > **Comments:**
  > **username_0**: I'm not sure I quite follow this. Is there something special about the '-lang' suffix on a section? Or are you suggesting multiple channels? I'm keen to have them all in the same multilingual section if possible, because nowhere else on the site has different sections for different locales.  
  > **username_1**: Yes, I actually thought that this is what you're doing, different channels for your locales. But yeah, if you have them all in one channel, then this doesn't work, of course. :D  
  
  ---
  
  