Enable/disable language selection on a per-user basis

  • App
    WoltLab Suite Core

    ... At least I think it's a feature suggestion, as I haven't found anything in the ACP that fits. Please pardon me if I've missed an existing or proposed setting that will accomplish this.



    Background:


    At first I was thinking of using WBB and friends on a multilingual site supporting Japanese and English users. Now it looks as though we'll be using it on a different site supporting Japanese users only. (Which means we'll probably be buying another license down the road for use on the originally intended site.)


    Since most or all of our users will be Japanese, we don't really need the language selector showing up in all the places it does (login page, post creation, etc.) It's possible that none of our users will ever need to change the language, and the presence of the flag icon and selector field could pose aesthetic issues (i.e., it's an unnecessary element that gets in the way of page design). I will, however, be administrating the site in English, and I would like to be able to switch the language setting for my account back and forth if need be. And it's not impossible that we may get other English-speaking users who would prefer to see English in the front end. So simply translating the front end and leaving the ACP in English isn't an optimum solution.


    While I've described the situation in terms of my own specific needs, there may be other users with similar needs who could benefit from a change such as I propose



    Discussion:


    When a site has more than one language installed, the software assumes that all users will want and need access to more than one language. That may not always be the case. Some administrators may wish to have more than one language installed, but still have the site appear as though it is a single-language site.


    In terms of programming, the software currently has an automatic function that decides whether to display the language selector or not:

    • If only one language is installed, it does not display the language selector.
    • If more than one language is installed, it displays the language selector.

    My proposal is to expose this function to granular control by the administrator in the latter case. This would make it easier for the admin to adjust the software's behavior to the needs of the site.



    Proposal:


    To make this happen, it would probably be necessary to add two new settings to the control panel:

    • A per-user option to specify whether the language selector is displayed for that user.
    • A global option to specify the default setting of the per-user option.

    First, let's add a new "Language selection" setting to the "Settings" tab of the "Edit User" page in the ACP. Let's make it a drop-down list or radio button selector that can be set to either "Enabled" or "Disabled". It could go either above or below the "Language" setting.


    => When the "Language Selection" option is set to "Enabled", the software functions exactly as it does now for the user in question.


    => When the "Language Selection" option is set to "Disabled", the following things happen:

    • The language selector is never displayed in the front end (post creation page, etc.) for logged-in users.
    • Users are not offered the option to change their language in their account settings.
    • All posts are therefore assigned to the language specified for the user in their account settings.

    This would allow the admin to enable or disable display of the language selector and language setting for individual users who need special handling.


    Second, let's add a new "Enable language selection by default" setting to the "Appearance - Languages - Multilingualism" pane of the ACP. (As a result, the "Multilingualism" pane will no longer be solely about the Multilingualism feature, so it might be a good idea to rename the pane from "Multilingualism" to something like "Language Options".) Let's make it a checkbox.


    => When the "Enable language selection by default" option is checked, the following things happen:

    • The per-user "Language Selection" option is automatically set to "Enabled" for any new user accounts that are created.
    • The language selector is displayed for guests and registered users who are not logged in.

    => When the "Enable language selection by default" option is checked, the following things happen:

    • The per-user "Language Selection" option is automatically set to "Disabled" for any new user accounts that are created.
    • The language selector is not displayed for guest users and registered users who are not logged in.

    This would allow the administrator to install multiple languages in a site without making multiple languages available to users (except on a per-user basis).



    I realize that this could involve quite a bit of work to address the needs of a relatively small set of users, but I feel that it would make the software more adaptable to a variety of situations. It's basically an extension of the concept behind the function that automatically hides the language selector when only one language is installed. Why present the user with choices they don't need?


    Respectfully submitted for your consideration...

    Edited 2 times, last by Dominion ().

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!