Answers.Body: <p>Untested, but should be fairly straightforward.</p>
  
  <pre><code>{% if craft.locale == 'de' %}
      {% set template = '_layout_de.html' %}
  {% else %}
      {% set template = '_layout.html' %}
  {% endif %}
  {% extends template %}
  </code></pre>
  
  <p>or</p>
  
  <pre><code>{% extends craft.locale == 'de' ? '_layout_de.html' : '_layout.html' %}
  </code></pre>
  
  <p>or using a locale folder (thank josh baker)</p>
  
  <pre><code>{% extends craft.locale ~ '/_layout' %}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-07-22T17:40:11.410Z
Answers.Text: You might also use string concatenation, which makes adding new layouts easier in future. For example `{% extends craft.locale ~ '/_layout' %}` would point to `/templates/en/_layout`.
Answers.UserDisplayName: Joshua Baker
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-07-23T16:03:14.387Z
Answers.Text: Great addition @JoshBaker
Answers.UserDisplayName: Douglas McDonald
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-07-27T11:14:59.130Z
Answers.Text: When I try that I get a "Multiple extends tags are forbidden" message returned. Something to do with the processing order perhaps where it's evaluating `extends` before the conditional construct?
Answers.UserDisplayName: Ian Young
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-07-27T15:33:08.663Z
Answers.Text: Most likely just doesn't like the multiple extends statements. I modified the example using a single extends and variables. Also, did you try one of the other methods?
Answers.UserDisplayName: Douglas McDonald
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-07-28T15:37:08.863Z
Answers.Text: The error message gave it away. :) In my case your other suggestion wouldn't fit my particular use case as it could be one of several and not just one or the other. I didn't notice Josh's suggestion though but it was the kind of pseudo logic I had in my head without quite knowing how to apply it. I've given it a try though and successfully got it to work along (with a slight tweak for my particular template folder structure: `{% extends "layouts/" ~ craft.locale ~ '/layout-name' %}`. Many thanks for the help and suggestions.
Answers.UserDisplayName: Ian Young
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-07-22T16:59:34.403Z
Answers.LastActivityDate: 2015-07-27T15:31:24.427Z
Answers.LastEditDate: 2015-07-27T15:31:24.427Z
Answers.UserDisplayName: Douglas McDonald
Body: <p>In my particular case I need to be able to switch the layout that the template extends. Is this possible to do using locales?</p>
  
Tags: <localization>
Title: Can locales be used to switch layouts?
ThreadText: # Can locales be used to switch layouts?
  
  (Asked by: username_0 on 2015-07-22)
  
  In my particular case I need to be able to switch the layout that the template extends. Is this possible to do using locales?
  
  **Tags:** localization
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2015-07-22. Score: 7 | Accepted answer
  
  Untested, but should be fairly straightforward.
  
  ```
  {% if craft.locale == 'de' %}
      {% set template = '_layout_de.html' %}
  {% else %}
      {% set template = '_layout.html' %}
  {% endif %}
  {% extends template %}
  
  ```
  
  or
  
  ```
  {% extends craft.locale == 'de' ? '_layout_de.html' : '_layout.html' %}
  
  ```
  
  or using a locale folder (thank josh username_2)
  
  ```
  {% extends craft.locale ~ '/_layout' %}
  
  ```
  
  > **Comments:**
  > **username_2**: You might also use string concatenation, which makes adding new layouts easier in future. For example `{% extends craft.locale ~ '/_layout' %}` would point to `/templates/en/_layout`.  
  > **username_1**: Great addition @JoshBaker  
  > **username_0**: When I try that I get a "Multiple extends tags are forbidden" message returned. Something to do with the processing order perhaps where it's evaluating `extends` before the conditional construct?  
  > **username_1**: Most likely just doesn't like the multiple extends statements. I modified the example using a single extends and variables. Also, did you try one of the other methods?  
  > **username_0**: The error message gave it away. :) In my case your other suggestion wouldn't fit my particular use case as it could be one of several and not just one or the other. I didn't notice Josh's suggestion though but it was the kind of pseudo logic I had in my head without quite knowing how to apply it. I've given it a try though and successfully got it to work along (with a slight tweak for my particular template folder structure: `{% extends "layouts/" ~ craft.locale ~ '/layout-name' %}`. Many thanks for the help and suggestions.  
  
  ---
  
  