Skip to content
New issue

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

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

Already on GitHub? # to your account

The locale option does not look like a valid locale: en_sg #24

Closed
devvpm opened this issue Feb 2, 2017 · 3 comments
Closed

The locale option does not look like a valid locale: en_sg #24

devvpm opened this issue Feb 2, 2017 · 3 comments
Labels

Comments

@devvpm
Copy link

devvpm commented Feb 2, 2017

I get this error on calling the humanReadable function.

The locale option does not look like a valid locale: en_sg

On passing the locale explicitly like below code it gives an other error.

$rrule->humanReadable(['locale'=>'en']);

( ! ) Fatal error: Call to a member function format() on null in /var/www/propsage/vendor/rlanvin/php-rrule/src/RRule.php on line 2362

@rlanvin
Copy link
Owner

rlanvin commented Feb 2, 2017

The locale option does not look like a valid locale: en_sg

You should try with en_SG. I think the check is a bit too strict, I'll have a look.

( ! ) Fatal error: Call to a member function format() on null in /var/www/propsage/vendor/rlanvin/php-rrule/src/RRule.php on line 2362

Ok what version of the lib are you using? This definitely looks like a bug, but on the master line 2362 is an empty line, and 'locale' => 'en' worked fine for me when I tested it.

Also, could you tell me if you have intl extension loaded?

Thank you.

@rlanvin rlanvin added the bug label Feb 2, 2017
rlanvin added a commit that referenced this issue Feb 2, 2017
- Rework `RRule::i18nLoad()` to accept locales such as `en_sg` and use `Locale::parseLocale` when possible
- Fix `humanReadable` fails with `intl` enable when the timezone is "Z"
@rlanvin
Copy link
Owner

rlanvin commented Feb 2, 2017

Please test again the new release 1.4.1 and let me know if that fixes your bug!

@devvpm
Copy link
Author

devvpm commented Feb 3, 2017

Yes, It fixed the problem, Thank you.

@devvpm devvpm closed this as completed Feb 3, 2017
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants