User tests: Successful: Unsuccessful:
This PR takes similar languages associations code from language filter, mod languages and some helpers and centralize it in JLanguageAssociations
.
It also ...
The components without menu item id now will have an alternate language association too.
For instance, the if current URI is a component without menu item (ex: /en/component/users/), the associated language URI will be the version of the component page in the other language (ex: /fr/component/users/).
Also there is a very slight performance improvement in a multilanguage site, because the language switcher and the language filter plugin now use the same method to get the languages associations, instead of doing that two times in each page.
Besides the new methods in JLanguageAssociations
, this introduces a new method JLanguageMultilang::getAvailableLanguages()
that is different from the JLanguageHelper::getLanguages()
.
JLanguageHelper::getLanguages()
only gets the content languages that are published.
JLanguageMultilang::getAvailableLanguages()
uses JLanguageHelper::getLanguages()
to get the content languages published and them does some checks to check if that language is really available to the user, it checks:
JLanguageMultilang::getSiteLangs()
JLanguageMultilang::getSiteHomePages()
And also returns the language object with the language menu item homepage id.
Improvements, suggestions and code revisions are welcome.
@infograf768, please check this one, when you have time.
Status | New | ⇒ | Pending |
Labels |
Added:
?
|
Category | ⇒ | Multilanguage |
Sure, i understnd that 3.5 is a priority for now and IMHO this should only go for 3.6.
Yes, it's a big change, because language switcher and mod_languages are now essencialy repeating the same process to get the language associations. Almost all changes are in the language associations meta tags in the language filter and in the language switcher that are now centralized in the language associations library, and, with that, reducing the code in mod_languages helper and language filter afterdispatch to minimum.
For less confusion and simpler tests, i did have some caution to not change the language filter behaviour itself.
Milestone |
Added: |
@infograf768 reminding you of this as requested
Milestone |
Removed: |
Milestone |
Removed: |
i know. andre and i decide we look deeper into this for 3.7
yeah you can put the 3.7.0 label on this one
Milestone |
Added: |
@infograf768 @andrepereiradasilva Is this ready for testing now?
no, will close this.
Category | Multilanguage | ⇒ | Administration Components Libraries Front End Modules Plugins Multilanguage |
Status | Pending | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2016-08-03 14:32:40 |
Closed_By | ⇒ | andrepereiradasilva |
This is a huge change. Please remind me after 3.5.0 release.