Success

User tests: Successful: Unsuccessful:

avatar phproberto
phproberto
28 Jul 2013

This adds the option to set the default language for a language field to the default frontend or backen language. Basically it adds the option to use:

default="site"
default="administrator"
default="active"

This also changes frontend user registration to use the automatically detected
language. Before it was selecting the first language.

It also allows devs to store a dynamic reference to the active language. For exampe if you want to always store the active frontend language you can save "site" and you always get the active language. Without this you would, for example, store en-GB and then if the language is changed you will keep getting en-GB.

Example loading of frontend active language:

            <field name="language" type="language"
                client="site"
                description="COM_USERS_USER_FIELD_FRONTEND_LANGUAGE_DESC"
                label="COM_USERS_USER_FIELD_FRONTEND_LANGUAGE_LABEL"
                required="true"
                filter="cmd"
                default="site"
            />

Example loading of backend active language:

            <field name="language" type="language"
                client="site"
                description="COM_USERS_USER_FIELD_FRONTEND_LANGUAGE_DESC"
                label="COM_USERS_USER_FIELD_FRONTEND_LANGUAGE_LABEL"
                required="true"
                filter="cmd"
                default="administrator"
            />

Example loading of automatically detected language:

            <field name="language" type="language"
                client="site"
                description="COM_USERS_USER_FIELD_FRONTEND_LANGUAGE_DESC"
                label="COM_USERS_USER_FIELD_FRONTEND_LANGUAGE_LABEL"
                required="true"
                filter="cmd"
                default="active"
            />

You can reference frontend active language with:
'site', 'frontend', '0'

You can reference backend active language with:
'admin', 'administrator', 'backend', '1'

You can reference automaically detected language with:
"active", "auto"

avatar phproberto phproberto - open - 28 Jul 2013
avatar infograf768
infograf768 - comment - 28 Jul 2013

Tested here:
we do get the defined default site language, but not the language of the page we are in when loading the registration form.

avatar phproberto
phproberto - comment - 28 Jul 2013

I have added the automatically detection of user language.

New options for the default attribute:

default="active"
default="auto"

avatar phproberto phproberto - close - 9 Aug 2013
avatar garyamort garyamort - reference | - 2 Dec 13

Add a Comment

Login with GitHub to post a comment