Restriction by language

Availability conditions ::: availability_language
Maintained by RenaatRenaat Debleu
Restrict module and section access based on user language.
Latest release:
1149 sites
823 downloads
52 fans
Current versions available: 9

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.

travisCoverage Status

Screenshots

Screenshot #0
Screenshot #1
Screenshot #2

Contributors

Renaat
Renaat Debleu (Lead maintainer)
Please login to view contributors details and/or to contact them

Comments RSS

Comments

  • Sat, Aug 2, 2014, 1:42 AM
    I'm sorry, I'm on my annual leave for the next two weeks. I'll get to approving submitted plugins as soon as I'm back. Thanks for understanding.
    In the meantime, you may want to fix the formal issues raised by the plugin checker that are displayed above.
  • Fri, Aug 22, 2014, 4:02 PM
    This is just awesome. Great idea, well implemented, huge possibilities. Well done Renaat. I am happy to go and approve this plugin now.

    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!
  • Renaat
    Sat, Aug 23, 2014, 1:54 AM
    The trailing spaces are gone and I fixed the hardcoded 'not'. Now the plugin is indeed more RTL language friendly.
    THX for reporting the bugs!
  • Sun, Aug 24, 2014, 12:43 PM
    Great!
    I've just linked here from MDL-46854 and https://moodle.org/mod/forum/discuss.php?d=82058
  • Mon, Aug 25, 2014, 4:16 PM
    Missing $string['description']
  • Mon, Aug 25, 2014, 4:26 PM
    I do not see the point of the "Any language" option!
  • Renaat
    Mon, Aug 25, 2014, 7:16 PM
    The description got 'lost in translation'. This is fixed in the latest version.

    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...
  • Renaat
    Tue, Aug 26, 2014, 4:53 PM
    'Any language' is history.
Please login to post comments