Restriction by language

Availability restriction ::: availability_language
Maintained by RenaatRenaat 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.

Tests Coverage 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

  • David Mudrák
    Fri, 22 Aug 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, 23 Aug 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!
  • Marina Glancy
    Sun, 24 Aug 2014, 12:43 PM
    Great!
    I've just linked here from MDL-46854 and https://moodle.org/mod/forum/discuss.php?d=82058
  • Joseph Rézeau
    Mon, 25 Aug 2014, 4:16 PM
    Missing $string['description']
  • Joseph Rézeau
    Mon, 25 Aug 2014, 4:26 PM
    I do not see the point of the "Any language" option!
  • Renaat
    Mon, 25 Aug 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, 26 Aug 2014, 4:53 PM
    'Any language' is history.
  • David Manning
    Thu, 23 Oct 2014, 3:39 AM
    Hi there, this is exactly the plugin we need for our organization. Is it possible to run it in 2.5.5+?
  • Renaat
    Thu, 23 Oct 2014, 3:13 PM
    Sorry about this, but conditional activities are 2.7+
  • Iñigo Zendegi Urzelai
    Wed, 26 Nov 2014, 8:14 PM
    We are using this plugin and works like a charm, thanks a lot Renaat!

    BTW, we've also translated it to Basque smile
  • Iñigo Zendegi Urzelai
    Wed, 17 Dec 2014, 11:55 PM
    Just for the record: there is a forum thread talking about this plugin to be included in the core:

    https://lang.moodle.org/mod/forum/discuss.php?d=3940
  • Gábor Takács
    Wed, 7 Jan 2015, 8:43 PM
    Is there any documentation how to set up this plugin?
    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?
  • Gábor Takács
    Wed, 7 Jan 2015, 9:57 PM
    Thank you Renaat for the fast answer! The problem was that I had to enable conditional access in admin/settings.php?section=optionalsubsystems. Now it works perfect.
  • Gareth Cooper
    Thu, 8 Jan 2015, 8:30 PM
    Hello Renaat, is there any way to *hide* sections of the other language groups, rather than simply restricting access? At the moment we can control access, but all content is still visible - is there something I should set to hide content for other language groups - at the moment, our display looks a little cluttered unless we can do this. Thanks for producing this useful plugin!
Please login to post comments