Answers.Body: <p>How about hiding the language switcher on the front-end?</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-06-30T08:38:38.353Z
Answers.Text: This is what I finally did (in addition to disable the entries and sections in this language), but this is not the perfect solution because :
  — By only disabling the language switcher, direct URLs to the entries are still accessible;
  — What if only one language of the languages switcher should be disabled?
Answers.UserDisplayName: Romain P.
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-06-30T09:19:56.997Z
Answers.Text: I understand - however, if the language switcher is hidden, then the visitor should only be able to browse the French 'version' of the site, yes?     Q: Is it likely that you are the only one who actually knows the direct URLs for German?
Answers.UserDisplayName: Matt P
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-06-30T12:03:19.657Z
Answers.Text: Most of the time I will be the only one to know those URLs. But suppose these URLs were indexed in search engines or that I had used these URLs in newsletters, these links could remain accessible. That's why I was looking for a more reliable and practical solution, assuming that this would be possible from the General Config Settings, but it seems not...
Answers.UserDisplayName: Romain P.
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-06-30T08:17:52.403Z
Answers.LastActivityDate: 2016-06-30T08:17:52.403Z
Answers.UserDisplayName: Matt P
Answers.Body: <p>What I would probably do is to create a new branch in version control that you can deploy to production as long as you have to disable the locales. The reason for this is that there are probably too many things you have to change in code and I wouldn’t want to clutter it with a lot of conditionals.</p>
  
  <p>In that new branch you would have to delete the index.php for the locales you want to disable to make all these URLs respond with a 404.</p>
  
  <p>And then remove all the references to the locale from your templates. Remove the language switcher altogether or remove just the locales you want to disable from the switcher code, e.g. remove the 'de' from <code>{% for locale in ['en', 'fr', 'de'] %}</code>.</p>
  
  <p>With the above changes in place, you wouldn’t have to disable on a per entry basis.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-06-30T09:42:47.473Z
Answers.LastActivityDate: 2016-06-30T09:42:47.473Z
Answers.UserDisplayName: carlcs
Body: <p>I started to develop my new Craft site in two languages (French &amp; German). Once done here, I have to put the website online temporarily in one of these two languages (French).</p>
  
  <p>So I turned off all sections and entries to disable the language (German) but:</p>
  
  <ul>
  <li>This was tedious and time consuming to do this manually via the CP</li>
  <li>domain.com/de/ now redirects to the homepage with empty content instead of redirect to the 404 page</li>
  </ul>
  
  <p>Questions :</p>
  
  <ul>
  <li>Is there a faster and safer way to temporarily disable a website language with the General Config Settings?</li>
  <li>Is it possible to disable some website languages depending on the environment and / or if devMode is enabled?</li>
  </ul>
  
Tags: <config><redirect><language><settings>
Title: Can I disable languages from the General Config Settings?
ThreadText: # Can I disable languages from the General Config Settings?
  
  (Asked by: username_0 on 2016-06-29)
  
  I started to develop my new Craft site in two languages (French & German). Once done here, I have to put the website online temporarily in one of these two languages (French).
  
  So I turned off all sections and entries to disable the language (German) but:
  
  * This was tedious and time consuming to do this manually via the CP
  * domain.com/de/ now redirects to the homepage with empty content instead of redirect to the 404 page
  
  Questions :
  
  * Is there a faster and safer way to temporarily disable a website language with the General Config Settings?
  * Is it possible to disable some website languages depending on the environment and / or if devMode is enabled?
  
  **Tags:** config, redirect, language, settings
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2016-06-30. Score: 2
  
  How about hiding the language switcher on the front-end?
  
  > **Comments:**
  > **username_0**: This is what I finally did (in addition to disable the entries and sections in this language), but this is not the perfect solution because : — By only disabling the language switcher, direct URLs to the entries are still accessible; — What if only one language of the languages switcher should be disabled?  
  > **username_1**: I understand - however, if the language switcher is hidden, then the visitor should only be able to browse the French 'version' of the site, yes?     Q: Is it likely that you are the only one who actually knows the direct URLs for German?  
  > **username_0**: Most of the time I will be the only one to know those URLs. But suppose these URLs were indexed in search engines or that I had used these URLs in newsletters, these links could remain accessible. That's why I was looking for a more reliable and practical solution, assuming that this would be possible from the General Config Settings, but it seems not...  
  
  ---
  
  ### Answer by username_2 on 2016-06-30. Score: 2
  
  What I would probably do is to create a new branch in version control that you can deploy to production as long as you have to disable the locales. The reason for this is that there are probably too many things you have to change in code and I wouldn’t want to clutter it with a lot of conditionals.
  
  In that new branch you would have to delete the index.php for the locales you want to disable to make all these URLs respond with a 404.
  
  And then remove all the references to the locale from your templates. Remove the language switcher altogether or remove just the locales you want to disable from the switcher code, e.g. remove the 'de' from `{% for locale in ['en', 'fr', 'de'] %}`.
  
  With the above changes in place, you wouldn’t have to disable on a per entry basis.
  
  
  ---
  
  