-
Notifications
You must be signed in to change notification settings - Fork 446
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
Latin locale not available under windows #1259
Comments
This is because "Latin" (la) is not part of the Windows compatible ISO-639-2 locale subset. ref.: https://docs.moodle.org/dev/Table_of_locales#Table we should probably review this and check if Win10+ can handle the unix type locales now. |
We have encountered this for the first time yesterday. The fix for this is a bit groky and I think the actual problem might still count as a bug(ish). I come from South Africa and we have a number of local official languages. This issue was first reported by a user with isiZulu set as their browser langauge. I was able to replicate this problem by setting my browser language to isiXhosa - not an unreasonable thing for Zulu/Xhosa speakers to do. This triggered the following error: This is derived from the 'Accept-Language' request header, which in my case is: The error suppression at line 1136 doesn't work at my current version of PHP (8.0.20). I am not sure if it worked previously: The fix, which is not ideal, is to manually change the I can't seem to find any other way around it. I would welcome a more robust solution if I missed it :-) |
@MissConstrued I was looking at the PHP 8 upgrade info, and noticed this:
https://www.php.net/manual/en/migration80.incompatible.php The constant() method will throw an error if the constant is not defined:
So in PHP 7 it probably didn't work either, but the supression did work. |
Hi. thanks for reporting this. I heard something similar recently, but your details are very good. Yes probably we should just add a check if the constant exists with |
Great :-) However, for anyone currently facing this issue (who doesn't want to edit base.php for the obvious reasons) a work around is to check and override |
fixed |
in base.php line 1136 in the function language() stats:
$locale=@constant('ISO::LC_'.$parts[0]);
This line generates an Internal Server Error of Undefined Constant ISO::LC_la
Any idea why and how to fix?
The text was updated successfully, but these errors were encountered: