-
Notifications
You must be signed in to change notification settings - Fork 662
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
Regression on Elgg 1.8: with system cache enabled language files with more than 2 characters in filename are not recognized #7187
Comments
Thanks so much for your research into this, @iionly. Wouldn't be too much to ask to narrow it down to a specific Elgg version or even a particular commit? |
It's broken since Elgg 1.8.14. The problem was introduced by the fix for #4840 (see 58ebe3f). I think the problem is in engine/lib/languages.php in function reload_all_translations(): if (preg_match('/([a-z]+)\.[^.]+$/', $filename, $matches)) { Underscores are not taken into account (and also no upper case letters in language file names). |
Edit: the cache handler already allows those characters: https://github.com/Elgg/Elgg/blob/1.8/engine/handlers/cache_handler.php#L47 So yes, it seems like we should allow those characters also in the language codes. |
Name of a cached language file can now have the following structure: - language code (2-3 lowercase alphabets) - underscore followed by regional designator (2 lowercase alphabets) Fixes Elgg#7187
Name of a cached language file can now have the following structure: - language code (2-3 lowercase alphabets) - underscore followed by regional designator (2 lowercase alphabets) Fixes Elgg#7187
… codes Name of a cached language file can now have the following structure: - language code (2-3 lowercase alphabets) - underscore followed by regional designator (2 lowercase alphabets) Fixes Elgg#7187
… codes Name of a cached language file can now have the following structure: - language code (2-3 lowercase alphabets) - underscore followed by regional designator (2 lowercase alphabets) Fixes Elgg#7187
See discussion: https://community.elgg.org/discussion/view/1852424/elgg-1819-isnt-recognizing-pt-br
If you have system cache enabled, language files don't work if their name has anything else than lowercase letters (e.g. hyphens, underscores, upper case letters).
If the language (for example pt_br) has been selected with system cache disabled, it is still used after system cache is enabled. But you wouldn't be able to re-select it again, if you switched to another language and new users can't select it at all (if the site's language isn't pt_br).
The problem exists on:
We should choose a language code standard in order to fix this properly. See #6856
The text was updated successfully, but these errors were encountered: