Answers.Body: <p>You can get the current locale’s name via <code>craft.i18n.getCurrentLocale()</code>.</p>
  
  <pre><code>{% set locale = craft.i18n.getCurrentLocale() %}
  {{ locale.name }}
  </code></pre>
  
  <p>That will output the name using the current locale’s translation.</p>
  
  <p>If you would prefer to output the locale’s name in its native tongue, use <code>nativeName</code> instead:</p>
  
  <pre><code>{{ locale.nativeName }}
  </code></pre>
  
  <p>You can also output the name of any locale using (not necessarily the current one) using <code>craft.i18n.getLocaleById()</code>:</p>
  
  <pre><code>{% set locale = craft.i18n.getLocaleById(entry.locale) %}
  {{ locale.name }}
  {{ locale.nativeName }}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-07-10T01:36:14.780Z
Answers.Text: Nice Brandon! Can you please add how to access the i18n name for non-current locales? Let's say all I have is a string "de". Thanks
Answers.UserDisplayName: carlcs
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-07-10T12:54:30.750Z
Answers.Text: @ChristianSeelbach updated ;)
Answers.UserDisplayName: Brandon Kelly
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-07-10T13:11:37.900Z
Answers.Text: Thanks! I now have to update [this answer](http://craftcms.stackexchange.com/a/882/125) a 6th time ;)
Answers.UserDisplayName: carlcs
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-07-10T00:30:11.727Z
Answers.LastActivityDate: 2014-07-10T12:54:21.663Z
Answers.LastEditDate: 2014-07-10T12:54:21.663Z
Answers.UserDisplayName: Brandon Kelly
Body: <p>When I output <code>{{ craft.locale }}</code> in my template, I get the current locale’s ID (e.g. “en”) rather than its name (e.g. “English”).</p>
  
  <p>How do I get the locale’s <strong>name</strong>?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-11-20T09:43:13.397Z
Comments.Text: For anyone coming here for `craft.locale`: It's deprecated, use `craft.app.language` now.
Comments.UserDisplayName: Timo Schwarzer
Tags: <templating><localization>
Title: How do I output the locale’s name?
ThreadText: # How do I output the locale’s name?
  
  (Asked by: username_0 on 2014-07-10)
  
  When I output `{{ craft.locale }}` in my template, I get the current locale’s ID (e.g. “en”) rather than its name (e.g. “English”).
  
  How do I get the locale’s **name**?
  
  **Tags:** templating, localization
  
  > **Comments:**
  > **username_1**: For anyone coming here for `craft.locale`: It's deprecated, use `craft.app.language` now.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2014-07-10. Score: 21 | Accepted answer
  
  You can get the current locale’s name via `craft.i18n.getCurrentLocale()`.
  
  ```
  {% set locale = craft.i18n.getCurrentLocale() %}
  {{ locale.name }}
  
  ```
  
  That will output the name using the current locale’s translation.
  
  If you would prefer to output the locale’s name in its native tongue, use `nativeName` instead:
  
  ```
  {{ locale.nativeName }}
  
  ```
  
  You can also output the name of any locale using (not necessarily the current one) using `craft.i18n.getLocaleById()`:
  
  ```
  {% set locale = craft.i18n.getLocaleById(entry.locale) %}
  {{ locale.name }}
  {{ locale.nativeName }}
  
  ```
  
  > **Comments:**
  > **username_2**: Nice username_0! Can you please add how to access the i18n name for non-current locales? Let's say all I have is a string "de". Thanks  
  > **username_0**: @ChristianSeelbach updated ;)  
  > **username_2**: Thanks! I now have to update [this answer](http://craftcms.stackexchange.com/a/882/125) a 6th time ;)  
  
  ---
  
  