<p>It looks like you need Craft Pro and even then it's not possible
to have the CP in a language that is not installed as a front-end locale.</p>

<p>The (new) <code>defaultCpLanguage</code> setting doesn't change this. See Brad's
answers here:<br>
<a href="https://craftcms.stackexchange.com/a/5001/125">Change system language</a> +<br>
<a href="https://craftcms.stackexchange.com/a/10576/125">German locale &amp; English CP language resulting in disappeared entries</a></p>

<p>But to help you with your date problem. It is possible to access most data from
<a href="https://github.com/pixelandtonic/Craft-Release/tree/master/app/framework/i18n/data" rel="nofollow noreferrer">craft/app/framework/i18n/data/</a> via <code>craft.i18n</code> methods.</p>

<pre><code>{% macro dateFormat(date, locale) %}
    {% set localeData = craft.i18n.getLocaleData(locale|default('de')) %}
    {{
        localeData.getWeekdayName(date|date('w')) ~ ', ' ~
        date|date('j ') ~
        localeData.getMonthName(date|date('m')) ~
        date|date(' Y')
    }}
{% endmacro %}
{% import _self as macros %}

{% for locale in ['en', 'es', 'fr', 'de', 'ru', 'nl', 'no'] %}
    &lt;li&gt;{{ macros.dateFormat(now, locale) }}&lt;/li&gt; 
{% endfor %}
</code></pre>

CC BY-SA 3.0
2015-10-29T22:31:14.913Z
2015-10-29T22:31:14.913Z
2017-04-13T12:51:00.253Z
carlcs
<p>If your looking to just replace month or day names you could do something like this:</p>

<pre><code>{% set translations = {
    'January': 'janvier', 
    'February': 'février', 
    'March':'mars', 
    'April':'avril'} 
 %}    

{{ entry.postDate|date('d F Y')|replace(translations) }}
</code></pre>

<p>You could add any amount of translations in that object.</p>

CC BY-SA 3.0
2015-10-29T19:52:43.847Z
2015-10-29T19:52:43.847Z
a-am
<p>How to retrieve the postDate of an entry in a different language than the CP.
In the general config settings i have the following,</p>

<pre><code>    'defaultCpLanguage' =&gt; 'en'
</code></pre>

<p>But i would like to display the dates in the frontend in a different language. As in translated month names. Is this possible?</p>

<p>I tried the following with no result:</p>

<pre><code>    {{ entry.postDate | date("d/F/y", "Europe/Paris") }}
    {{entry.postDate.format("d F y")}} #}
    &lt;span class="date"&gt;{{entry.postDate | date('d F Y')}}&lt;/span&gt;
</code></pre>

<p>The format works, but there is no translation.</p>

CC BY-SA 3.0
2015-10-29T10:42:16.997Z
I came across this post: http://craftcms.stackexchange.com/questions/1127/is-it-possible-to-output-month-names-in-my-native-language is there a better solution around? or is this the only way? So to summarize you should install craft in your native language and after that set the CP to English?
Jacob
CC BY-SA 3.0
2015-10-29T13:10:20.143Z
I changed the locale in the database as explained in the question above but now my CP is in the same language as the db i thought defaultCpLanguage would override this...this makes no sense
Jacob
CC BY-SA 3.0
2015-10-29T15:32:23.447Z
I don't think I'm following 100%. The language the CP is being displayed in and the locale that is being displayed on the front-end are two separate things. Can you clarify more what you're trying to do?
Brad Bell
CC BY-SA 3.0
2015-10-29T22:38:04.020Z
That second parameter you set to "Europe/Paris" in the `date` filter is to set the timezone, NOT the language!
carlcs
<localization><control-panel><language><postdate>
Output postDate in a different language than CP
# Output postDate in a different language than CP

(Asked by: username_0 on 2015-10-29)

How to retrieve the postDate of an entry in a different language than the CP.
In the general config settings i have the following,
    'defaultCpLanguage' => 'en'

But i would like to display the dates in the frontend in a different language. As in translated month names. Is this possible?
I tried the following with no result:
    {{ entry.postDate | date("d/F/y", "Europe/Paris") }}
    {{entry.postDate.format("d F y")}} #}
    {{entry.postDate | date('d F Y')}}

The format works, but there is no translation.

**Tags:** localization, control-panel, language, postdate

> **Comments:**
> **username_0**: I came across this post: http://craftcms.stackexchange.com/questions/1127/is-it-possible-to-output-month-names-in-my-native-language is there a better solution around? or is this the only way? So to summarize you should install craft in your native language and after that set the CP to English?  
> **username_0**: I changed the locale in the database as explained in the question above but now my CP is in the same language as the db i thought defaultCpLanguage would override this...this makes no sense  
> **username_1**: I don't think I'm following 100%. The language the CP is being displayed in and the locale that is being displayed on the front-end are two separate things. Can you clarify more what you're trying to do?  
> **username_2**: That second parameter you set to "Europe/Paris" in the `date` filter is to set the timezone, NOT the language!  

---

## 2 answers

### Answer by username_2 on 2015-10-29. Score: 2

It looks like you need Craft Pro and even then it's not possible
to have the CP in a language that is not installed as a front-end locale.
The (new) defaultCpLanguage setting doesn't change this. See Brad's
answers here:
Change system language +
German locale & English CP language resulting in disappeared entries
But to help you with your date problem. It is possible to access most data from
craft/app/framework/i18n/data/ via craft.i18n methods.
{% macro dateFormat(date, locale) %}
    {% set localeData = craft.i18n.getLocaleData(locale|default('de')) %}
    {{
        localeData.getWeekdayName(date|date('w')) ~ ', ' ~
        date|date('j ') ~
        localeData.getMonthName(date|date('m')) ~
        date|date(' Y')
    }}
{% endmacro %}
{% import _self as macros %}

{% for locale in ['en', 'es', 'fr', 'de', 'ru', 'nl', 'no'] %}
    {{ macros.dateFormat(now, locale) }} 
{% endfor %}


---

### Answer by username_3 on 2015-10-29. Score: 1

If your looking to just replace month or day names you could do something like this:
{% set translations = {
    'January': 'janvier', 
    'February': 'février', 
    'March':'mars', 
    'April':'avril'} 
 %}    

{{ entry.postDate|date('d F Y')|replace(translations) }}

You could add any amount of translations in that object.


---

