Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LC_MESSAGES, windows 7 / 10, Locale, Symfony2.8 #8

Closed
mmstoyanov opened this issue Mar 23, 2016 · 12 comments
Closed

LC_MESSAGES, windows 7 / 10, Locale, Symfony2.8 #8

mmstoyanov opened this issue Mar 23, 2016 · 12 comments

Comments

@mmstoyanov
Copy link

I'm stuck on that:

Notice: Use of undefined constant LC_MESSAGES - assumed 'LC_MESSAGES' in C:\xampp\htdocs\symfony2_8project\vendor\leaseweb\gettext-translation-bundle\Lsw\GettextTranslationBundle\Routing\GettextLocaleListener.php on line 56

Warning: setlocale(): Invalid locale category name LC_MESSAGES, must be one of LC_ALL, LC_COLLATE, LC_CTYPE, LC_MONETARY, LC_NUMERIC, or LC_TIME in C:\xampp\htdocs\symfony2_8project\vendor\leaseweb\gettext-translation-bundle\Lsw\GettextTranslationBundle\Routing\GettextLocaleListener.php on line 56

Fatal error: Uncaught exception 'Symfony\Component\Routing\Exception\InvalidParameterException' with message 'Requested locale 'en_US' could not be set.
Is this locale installed? Hint: Execute 'locale -a' on the Linux command line to list installed locales.'
in C:\xampp\htdocs\symfony2_8project\vendor\leaseweb\gettext-translation-bundle\Lsw\GettextTranslationBundle\Routing\GettextLocaleListener.php:58
Stack trace:
#0 [internal function]: Lsw\GettextTranslationBundle\Routing\GettextLocaleListener->onKernelRequest(Object(Symfony\Component\HttpKernel\Event\GetResponseEvent), 'kernel.request', Object(Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher))
#1 C:\xampp\htdocs\symfony2_8project\vendor\symfony\symfony\src\Symfony\Component\EventDispatcher\EventDispatcher.php(181): call_user_func(Array, Object(Symfony\Component\HttpKernel\Event\GetResponseEvent), 'kernel.request', Object(Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher))
#2 C:\xampp\htdocs\symfony_projec in C:\xampp\htdocs\symfony2_8project\vendor\leaseweb\gettext-translation-bundle\Lsw\GettextTranslationBundle\Routing\GettextLocaleListener.php on line 58

@mevdschee
Copy link
Contributor

Please try to uncomment "extension=php_intl.dll" in "php.ini" and report back what changed.

@mmstoyanov
Copy link
Author

Unfortunately there is no differences with uncommenting the php_intl.dl file. The error is the same.

@mevdschee
Copy link
Contributor

Did you restart Apache?

@mmstoyanov
Copy link
Author

Yes, Of course. But I think it is a problem of how my PHP was compiled. I'm trying to find some solution based on this theory.

@mevdschee
Copy link
Contributor

AFAIK Symfony checks environment dependencies during setup and "intl" is one of them. Did you skip that step? Can you start a new Symfony project and check?

@mmstoyanov
Copy link
Author

Mhm, I see. Ok, I will follow your suggestions and come back with the result.

@mmstoyanov
Copy link
Author

The Error is still existing. I'm receiving it after Step 2: Enable the bundle of Installation process.

@mevdschee
Copy link
Contributor

After reading: http://symfony.com/doc/current/components/intl.html

It seems to me that install "intl" is not mandatory (or mandatory anymore).

Can you run phpinfo and verify intl is enabled, see: http://grokbase.com/t/php/php-windows/13cer8rnj4/phpinfo-not-finding-intl-and-mbstring

For installation instructions also check: http://php.net/manual/en/intl.installation.php

@mmstoyanov
Copy link
Author

PHPinfo show me that I have all of them installed and enabled:

  • intl / mbstring / gettext

I installed intl through composer, too.
I used this: http://symfony.com/doc/2.8/components/intl.html

The problem still exists.

@mevdschee
Copy link
Contributor

If you installed "intl", then the "Notice" and "Warning" should be gone. The "Fatal" may be solved by spelling the locale in the way the system supports it. On windows 7 it seems to be "en-US" not "en_US". Set this in "Resources/config/config.yml". Maybe that will solve your problem.

@mmstoyanov
Copy link
Author

Ok, "Notice" and "Warning" are solved by changing "LC_MESSAGES" to "LC_ALL" into:
GettextLocaleListener.php

No difference for how the locale is going to be set in config.yml. I've tried them all: "en-US", "en_US", "en", clearing the cache, by the console.

@mevdschee
Copy link
Contributor

Maybe you can try a few steps from this bug report to see how your environment behaves:

https://bugs.php.net/bug.php?id=66265

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants