User tests: Successful: Unsuccessful:
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.
@richard67 @andrepereiradasilva @Kubik-Rubik
Thanks for testing.
Status | New | ⇒ | Pending |
Labels |
Added:
?
?
|
Category | ⇒ | Administration |
@andrepereiradasilva
Ok for the order. Will wait all comments to update.
Asking @brianteeman for the string change.
I have tested this item successfully on dbd6920
Tested with success. Works as discussed in #9119 at the end.
I have tested this item successfully on dbd6920
At this point - works as described.
NOTE: the btn appears even if we have only one language istalled on backend
This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9126.
For consistency I think that this should be referred to as Administrator Language and not Backend Language
This PR has received new commits.
CC: @MATsxm, @richard67
I have modified the language strings as well as the order of the buttons.
@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".
I have tested this item successfully on 295bf8c
I have tested this item successfully on 295bf8c
#9126 works as expected - Thanks
Status | Pending | ⇒ | Ready to Commit |
rtc. thanks for feedback and testing.
Labels |
Added:
?
|
This PR has received new commits.
CC: @MATsxm, @richard67
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.
I have tested this item 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.
I have tested this item successfully on 49595b0
Thanks
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
@infograf768 Thanks for the info, I just was curious. For me it is fine now as it is.
i think you could also use JLanguage::parseXMLLanguageFile($path);
don't really know the difference.
@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
I have tested this item successfully on 49595b0
Works perfectly for me - thanks @infograf768
@brianteeman Ahhhh, sure, you are right. Silly me!
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
Works as intended for me. Thanks JM
Status | Ready to Commit | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2016-02-18 10:27:44 |
Closed_By | ⇒ | wilsonge |
Milestone |
Added: |
@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.
Labels |
Removed:
?
|
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.
I have a solution for that. Will make a new PR for both Default and Switch.
@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