pierrestoffe / craft-language-redirector

Craft CMS plugin to automatically redirect visitors to their preferred language
Other
16 stars 5 forks source link

Class 'Locale' not found #6

Closed intoeetive closed 6 years ago

intoeetive commented 6 years ago

I'm trying to use language redirector 1.0.7 on latest Craft (3.0.20), but getting this error on frontend: Class 'Locale' not found pointing to line 48 in \vendor\pierrestoffe\craft-language-redirector\src\variables\LanguageSwitcher.php

pierrestoffe commented 6 years ago

Hi @intoeetive.

You seem to be missing the php-intl extension. You should make sure to install the package if you don't have it already and enable it in your php.ini file.

I'll add it to the README. In the meantime you can find more info here: https://www.dotkernel.com/php-troubleshooting/where-is-the-intl-php-extension-problem-solved/

intoeetive commented 6 years ago

Thanks for the explanation.

Would you consider using Craft's own Locale class instead? While php-intl is recommended, it's not required by Craft itself and I hope there's a way to install language switch without going to server administrator or hosting support.

pierrestoffe commented 6 years ago

You're totally right, I don't know why I didn't use it in the first place. This is implemented in https://github.com/pierrestoffe/craft-language-redirector/releases/tag/1.0.8.