<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>

CC BY-SA 3.0
2014-07-10T01:36:14.780Z
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
carlcs
CC BY-SA 3.0
2014-07-10T12:54:30.750Z
@ChristianSeelbach updated ;)
Brandon Kelly
CC BY-SA 3.0
2014-07-10T13:11:37.900Z
Thanks! I now have to update [this answer](http://craftcms.stackexchange.com/a/882/125) a 6th time ;)
carlcs
CC BY-SA 3.0
2014-07-10T00:30:11.727Z
2014-07-10T12:54:21.663Z
2014-07-10T12:54:21.663Z
Brandon Kelly
<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>

CC BY-SA 4.0
2019-11-20T09:43:13.397Z
For anyone coming here for `craft.locale`: It's deprecated, use `craft.app.language` now.
Timo Schwarzer
<templating><localization>
How do I output the locale’s name?
# 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 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  
> **username_0**: @ChristianSeelbach updated ;)  
> **username_2**: Thanks! I now have to update [this answer](http://craftcms.stackexchange.com/a/882/125) a 6th time ;)  

---

