Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8500615
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T00:59:35+00:00 2026-06-11T00:59:35+00:00

There is something I do not understand with locale management in Symfony2. I want

  • 0

There is something I do not understand with locale management in Symfony2. I want to write month name in French with date Twig method. Is it possible? I can’t do it.

It seems that my locale is not taken into account.

Here is my app/config/config.yml file:

framework:
    #esi:             ~
    translator:      { fallback: fr }
    secret:          %secret%
    charset:         UTF-8
    router:          { resource: "%kernel.root_dir%/config/routing.yml" }
    form:            true
    csrf_protection: true
    validation:      { enable_annotations: true }
    templating:      { engines: ['twig'] } #assets_version: SomeVersionScheme
    session:
        default_locale: fr
        auto_start:     true

Session locale seems good:

echo $this->get('session')->getLocale();  // Returns "fr"
die;

Yet, when I am using, in my view, the following:

<td class="month">{{ history.date|date('F Y') }}</td>

It returns me “July 2011” for instance, instead of “Juillet 2011”.

What am I misunderstanding? Shouldn’t the date filter be localized? If not, how can I do to retrieve correct terms? I used to use I18N to translate all the month names, but I do not think it is the best practice.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T00:59:37+00:00Added an answer on June 11, 2026 at 12:59 am

    date does not return localized string. You have to use strftime for that. Alternatively you can use SonataIntlBundle if you want more control.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

There is something I do not understand with the Apps Script GUI Builder. I
want to ask user to input something but not want to wait forever. There
Exact duplicate of Function name for creating something if it's not there yet I
There's something I'm not quite understanding about the use of boilerpipe's ArticleExtractor class. Albeit,
Brand new to the Log4Net library and there is something I have not been
math.h is not really a documentation. Is there something else that will describe these
I've read this answer about eight-five times, but there's something I'm not understanding correctly:
There is something I am trying to accomplish although I'm not really sure where
Is there a way for something to raise and exception that does not descend
I'm trying to write my own little PNG reader in Python. There is something

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.