Moodle plugins directory: Restriction by language | Moodle.org
Restriction by language
Availability restriction ::: availability_language
Maintained by Renaat Debleu
Restrict module and section access based on user language.
Latest release:
1945 sites
484 downloads
64 fans
Current versions available: 11
Language filters are great, but sometimes they can make your resources and activities very complex. This availability condition makes it easy to show an English resource only to English users and an activity in French only to French speaking students.
Check the global documentation about conditional availability settings first.
This plugin only pops up when
- There is more than 1 language installed in the system (obvious, we need a least 2 languages installed to restrict)
- When the language of the course is NOT forced. (Course - Edit settings - Appearance - Force language). When a course has a forced language, everything will be shown in this language and we are certain no user will ever arrive with another language enabled. On that moment there is no need to show the restriction, as it would only create the illusion that people could be restricted.
WARNING: The Moodle Mobile app filters resources and activities using the language of the smart phone, not using the language of the Moodle app.
Useful links
Contributors
Renaat Debleu (Lead maintainer)
Please login to view contributors details and/or to contact them
The only thing I would suggest is to get rid of trailing spaces in the string files. Moodle localisation tools do not allow translations to have them so the English must work without them, too. The other bug is the hardcoded 'not' string in \availability_language\condition::get_description() Instead, I would suggest to have two strings that accept the name of the language as the {$a} placeholder. Attempting to concatenate strings may easily fail for non-English languages.
With the hope this would be fixed soon, you are cleared to land. Welcome to the Plugins directory!
THX for reporting the bugs!
I've just linked here from MDL-46854 and https://moodle.org/mod/forum/discuss.php?d=82058
The 'Any Language' option is a more difficult issue. It is doing nothing for the moment. I got the idea from the availibility_condition group, and tried to figure out a hundred or more variations with languages. It is clear to me that there is always one language selected/forced, so this option can be removed. But every time I wanted to do this, I started searching for a scenario where an extra option could be helpful...
BTW, we've also translated it to Basque
https://lang.moodle.org/mod/forum/discuss.php?d=3940
I have installed it and it is present in the plugins overview page.
Where should I set up the restriction? (I search it in the course's activity's settings, but no such "Restrict Access" block there.) Can anybody help?