Answers.Body: <p>You could do this by adding the locale ID as a class to the body tag and then use a technique like described in this nice CSS-Tricks to add the quotes depending on that body class.</p>
  
  <p><a href="https://css-tricks.com/almanac/properties/q/quotes/" rel="nofollow">https://css-tricks.com/almanac/properties/q/quotes/</a></p>
  
  <p>If you want them to be in the HTML you could write a quick Twig macro that adds the quotes depending on the locale ID.</p>
  
  <pre><code>{% macro wrapInQuotes(string) %}
      {%- set quotes = {
          'en': ['“', '”'],
          'de': ['„', '“'],
          'fr': ['« ', ' »'],
      } %}
  
      {{- quotes[craft.locale][0] }}
      {{- string }}
      {{- quotes[craft.locale][1] -}}
  {% endmacro %}
  
  {% import _self as macros %}
  {{ macros.wrapInQuotes(entry.quote) }}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-07-27T17:18:53.163Z
Answers.LastActivityDate: 2016-07-27T17:18:53.163Z
Answers.UserDisplayName: carlcs
Body: <p>I want to show quotes for my french visitors like so:</p>
  
  <blockquote>
    <p>« Something intelligent someone said. »</p>
  </blockquote>
  
  <p>but visitors of my english locale should see the quotes formatted like so:</p>
  
  <blockquote>
    <p>“Something intelligent someone said.”</p>
  </blockquote>
  
Tags: <templating>
Title: Wrap a quote in differently styled quotes depending on locale?
ThreadText: # Wrap a quote in differently styled quotes depending on locale?
  
  (Asked by: username_0 on 2016-07-27)
  
  I want to show quotes for my french visitors like so:
  
  > « Something intelligent someone said. »
  
  but visitors of my english locale should see the quotes formatted like so:
  
  > “Something intelligent someone said.”
  
  **Tags:** templating
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2016-07-27. Score: 3 | Accepted answer
  
  You could do this by adding the locale ID as a class to the body tag and then use a technique like described in this nice CSS-Tricks to add the quotes depending on that body class.
  
  <https://css-tricks.com/almanac/properties/q/quotes/>
  
  If you want them to be in the HTML you could write a quick Twig macro that adds the quotes depending on the locale ID.
  
  ```
  {% macro wrapInQuotes(string) %}
      {%- set quotes = {
          'en': ['“', '”'],
          'de': ['„', '“'],
          'fr': ['« ', ' »'],
      } %}
  
      {{- quotes[craft.locale][0] }}
      {{- string }}
      {{- quotes[craft.locale][1] -}}
  {% endmacro %}
  
  {% import _self as macros %}
  {{ macros.wrapInQuotes(entry.quote) }}
  
  ```
  
  
  ---
  
  