Jarek Jakubowski
Jarek Jakubowski

Reputation: 976

Symfony setlocale()

I want to use setlocale() to get translated months in my whole app. In which file should I put the usage of this function?

My code for now:

setlocale(LC_ALL, 'pl_PL.utf8');
$date = ucfirst(strftime('%B %Y'));

More general question: In Symfony, where should I put some globally evaluated scripts?

EDIT:

I need this in all environments and in console too, so putting it into app_dev.php or Request listener is not my case.

Configuring Apache locally would not solve the problem because I use different configurations on different machines (Apache/nginx).

Putting it into AppKernel didn't work, for now it sits in app/autoload.php, but I believe there is a better place for it.

Upvotes: 1

Views: 702

Answers (1)

Sylvain Guilbert
Sylvain Guilbert

Reputation: 722

best practice would be to configure apache local,

but you can put this in /app/AppKernel.php

Upvotes: 2

Related Questions