? ? Success

User tests: Successful: Unsuccessful:

avatar infograf768
infograf768
15 Feb 2016

This PR adds a new Toolbar Button to let admin switch the Backend Language to any language.
It replaces #9119 which was only letting switch to the Default Admin Language.

The purpose of the PR is to facilitate the work of devs, translators and admins in general.

After PR, one will get:
screen shot 2016-02-15 at 09 14 16

@richard67 @andrepereiradasilva @Kubik-Rubik
Thanks for testing.

avatar infograf768 infograf768 - open - 15 Feb 2016
avatar infograf768 infograf768 - change - 15 Feb 2016
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 15 Feb 2016
Labels Added: ? ?
avatar infograf768 infograf768 - change - 15 Feb 2016
Category Administration
avatar andrepereiradasilva
andrepereiradasilva - comment - 15 Feb 2016

@infograf768 for usability how about reordering the buttons, first the ones related with options selected, them the general ones (not related to the options selected).

Also what to do you think of instead "Switch Backend Language" having "Switch to Language". Since the button only appear on the admin languages, IMHO probably makes more sense.

In other words:

instead of: Default | Install Languages | Switch Backend Language

this: Default | Switch to Language | Install Languages

avatar infograf768
infograf768 - comment - 15 Feb 2016

@andrepereiradasilva
Ok for the order. Will wait all comments to update.
Asking @brianteeman for the string change.

avatar richard67 richard67 - test_item - 15 Feb 2016 - Tested successfully
avatar richard67
richard67 - comment - 15 Feb 2016

I have tested this item :white_check_mark: successfully on dbd6920

Tested with success. Works as discussed in #9119 at the end.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9126.

avatar MATsxm MATsxm - test_item - 15 Feb 2016 - Tested successfully
avatar MATsxm
MATsxm - comment - 15 Feb 2016

I have tested this item :white_check_mark: successfully on dbd6920


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9126.

avatar MATsxm
MATsxm - comment - 15 Feb 2016

At this point - works as described.

NOTE: the btn appears even if we have only one language istalled on backend
screen shot 2016-02-15 at 06 08 50


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9126.

avatar brianteeman
brianteeman - comment - 15 Feb 2016

For consistency I think that this should be referred to as Administrator Language and not Backend Language


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9126.

avatar joomla-cms-bot
joomla-cms-bot - comment - 16 Feb 2016

This PR has received new commits.

CC: @MATsxm, @richard67


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9126.

avatar infograf768
infograf768 - comment - 16 Feb 2016

I have modified the language strings as well as the order of the buttons.

This gives:
screen shot 2016-02-16 at 08 00 20

@MATsxm The button will behave the same way as the "Default" button which also displays when only one language is installed.

@andrepereiradasilva I guess that Switch Language does not need the "to".

Please test again

@dgt41
I prefer to let you make a specific PR for your request as I would not know where to stop the "else".

avatar richard67 richard67 - test_item - 16 Feb 2016 - Tested successfully
avatar richard67
richard67 - comment - 16 Feb 2016

I have tested this item :white_check_mark: successfully on 295bf8c


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9126.

avatar MATsxm MATsxm - test_item - 16 Feb 2016 - Tested successfully
avatar MATsxm
MATsxm - comment - 16 Feb 2016

I have tested this item :white_check_mark: successfully on 295bf8c

#9126 works as expected - Thanks


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9126.

avatar infograf768 infograf768 - change - 16 Feb 2016
Status Pending Ready to Commit
avatar infograf768
infograf768 - comment - 16 Feb 2016

rtc. thanks for feedback and testing.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9126.

avatar joomla-cms-bot joomla-cms-bot - change - 16 Feb 2016
Labels Added: ?
avatar joomla-cms-bot
joomla-cms-bot - comment - 17 Feb 2016

This PR has received new commits.

CC: @MATsxm, @richard67


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9126.

avatar infograf768
infograf768 - comment - 17 Feb 2016

Folks, I will ask you to test again, sorry.
@brianteeman suggested that I change the success message to display the language Name and not the language Tag.
I think it is indeed much better.

One will now get:
screen shot 2016-02-17 at 12 24 55

@richard67 @MATsxm @andrepereiradasilva @brianteeman

avatar richard67 richard67 - test_item - 17 Feb 2016 - Tested successfully
avatar richard67
richard67 - comment - 17 Feb 2016

I have tested this item :white_check_mark: successfully on 49595b0

Just tested, works as before plus language full name instead of tag is used in the success message.

@infograf768 What last screenshot does not show (because I think you switched from English to English) is that the success message is in the language from before switching, as your first screenshot in the test description shows (switched from English to Italian: Title "Messagio" in Italian but message content in English. I guess we cannot change this in an easy way, otherwise you would have done it, right? Or is it by purpose?

I also assume that there is no other easy way to get the language full name so you have to parse the XML file, right?

Or could it maybe be obtained from the language lists's 1st column, e.g. with jQuery?

Anyway, for me it is good enough as it is now, and I hope it will go into 3.5.0 Beta 3 or RC.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9126.

avatar MATsxm MATsxm - test_item - 17 Feb 2016 - Tested successfully
avatar MATsxm
MATsxm - comment - 17 Feb 2016

I have tested this item :white_check_mark: successfully on 49595b0

Thanks


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9126.

avatar infograf768
infograf768 - comment - 17 Feb 2016

as your first screenshot in the test description shows (switched from English to Italian: Title "Messagio" in Italian but message content in English. I guess we cannot change this in an easy way, otherwise you would have done it, right?

Same issue when the user is set to Default Language and another language is set to default. The content of the message is picked from the former language. No idea how to solve this. If it is possible this should be another PR imho.

I did parse the xx-XX.xml file indeed. Easy enough. code is

        $file = JPATH_ADMINISTRATOR . '/language/' . $cid . '/' . $cid . '.xml';
        $info = JInstaller::parseXMLInstallFile($file);
        $languageName = $info['name'];

        if ($model->switchAdminLanguage($cid))
        {
            $msg = JText::sprintf('COM_LANGUAGES_MSG_SWITCH_ADMIN_LANGUAGE_SUCCESS', $languageName);
            $type = 'message';
        }
        else
avatar richard67
richard67 - comment - 17 Feb 2016

@infograf768 Thanks for the info, I just was curious. For me it is fine now as it is.

avatar andrepereiradasilva
andrepereiradasilva - comment - 17 Feb 2016

i think you could also use JLanguage::parseXMLLanguageFile($path); don't really know the difference.

avatar brianteeman
brianteeman - comment - 17 Feb 2016

@richard67 @infograf768 isnt the message always in english right now because it is a new language string that doesnt exist in the other languages so en-gb is always used as a fallback


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9126.

avatar brianteeman brianteeman - test_item - 17 Feb 2016 - Tested successfully
avatar brianteeman
brianteeman - comment - 17 Feb 2016

I have tested this item :white_check_mark: successfully on 49595b0

Works perfectly for me - thanks @infograf768


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9126.

avatar richard67
richard67 - comment - 17 Feb 2016

@brianteeman Ahhhh, sure, you are right. Silly me!

avatar infograf768
infograf768 - comment - 17 Feb 2016

@andrepereiradasilva

i think you could also use JLanguage::parseXMLLanguageFile($path); don't really know the difference.

It is deprecated.
https://github.com/joomla/joomla-cms/blob/staging/libraries/cms/application/helper.php#L229-L231

avatar gwsdesk
gwsdesk - comment - 17 Feb 2016

Works as intended for me. Thanks JM

avatar wilsonge wilsonge - change - 18 Feb 2016
Status Ready to Commit Closed
Closed_Date 0000-00-00 00:00:00 2016-02-18 10:27:44
Closed_By wilsonge
avatar wilsonge wilsonge - reference | 029b170 - 18 Feb 16
avatar wilsonge wilsonge - merge - 18 Feb 2016
avatar wilsonge wilsonge - close - 18 Feb 2016
avatar wilsonge wilsonge - change - 18 Feb 2016
Milestone Added:
avatar richard67
richard67 - comment - 18 Feb 2016

@infograf768 Thanks a lot for this great new feature. It helps a lot with testing (multi) language stuff in backend. I think it is worth to be mentioned in the new features of the release notes with an own head line.

avatar joomla-cms-bot joomla-cms-bot - change - 18 Feb 2016
Labels Removed: ?
avatar infograf768 infograf768 - head_ref_deleted - 18 Feb 2016
avatar infograf768
infograf768 - comment - 18 Feb 2016

BTW:

isnt the message always in english right now because it is a new language string that doesnt exist in the other languages so en-gb is always used as a fallback

Nope. As I stated above #9126 (comment) the message is in the former language. It is the same as Default change as you can test by setting an admin language to Default when logged with a user set to use Default language.

avatar infograf768
infograf768 - comment - 18 Feb 2016

I have a solution for that. Will make a new PR for both Default and Switch.

Add a Comment

Login with GitHub to post a comment