Feature PR-4.4-dev Pending

User tests: Successful: Unsuccessful:

avatar laoneo
laoneo
17 May 2023

Summary of Changes

Introduces a new interface to set a language on an object. This will ease the transition phase from the static Text class to injected language dependency. Beside that we have now a way to get a language object by injection instead of Factory::getLanguage().

Testing Instructions

  • Open the back end articles view
  • Open the media manager

Actual result BEFORE applying this Pull Request

Everything is translated.

Expected result AFTER applying this Pull Request

Everything is translated.

Link to documentations

Please select:

  • Documentation link for docs.joomla.org:

  • No documentation changes for docs.joomla.org needed

  • Pull Request link for manual.joomla.org:

  • No documentation changes for manual.joomla.org needed

avatar joomla-cms-bot joomla-cms-bot - change - 17 May 2023
Category Administration com_content Libraries Front End Plugins Unit Tests
avatar laoneo laoneo - open - 17 May 2023
avatar laoneo laoneo - change - 17 May 2023
Status New Pending
cd9cff9 17 May 2023 avatar laoneo cs
avatar laoneo laoneo - change - 17 May 2023
Labels Added: ? PR-4.4-dev
avatar joomla-cms-bot joomla-cms-bot - change - 17 May 2023
Category Administration com_content Libraries Front End Plugins Unit Tests Administration com_categories com_content com_contenthistory com_cpanel com_fields com_joomlaupdate com_menus com_modules com_plugins com_templates com_workflow Front End com_contact Libraries Plugins
avatar joomla-cms-bot joomla-cms-bot - change - 17 May 2023
Category Administration com_content Libraries Front End Plugins com_categories com_contenthistory com_cpanel com_fields com_joomlaupdate com_menus com_modules com_plugins com_templates com_workflow com_contact Administration com_admin com_categories com_content com_contenthistory com_cpanel com_fields com_finder com_joomlaupdate com_menus com_modules com_plugins com_templates com_workflow
avatar laoneo laoneo - change - 17 May 2023
Labels Removed: ?
avatar laoneo laoneo - change - 17 May 2023
The description was changed
avatar laoneo laoneo - edited - 17 May 2023
avatar richard67
richard67 - comment - 17 May 2023

@laoneo Unit tests are failing, see https://ci.joomla.org/joomla/joomla-cms/65844/1/11 . All 9 errors are of this type:

TypeError: Argument 1 passed to Joomla\CMS\Plugin\CMSPlugin::setLanguage() must be an instance of Joomla\CMS\Language\Language, null given, called in /drone/src/libraries/src/Plugin/CMSPlugin.php on line 383
35761e9 26 May 2023 avatar laoneo docs
avatar laoneo laoneo - change - 10 Jun 2023
Labels Added: Feature
avatar laoneo
laoneo - comment - 10 Jun 2023

Beside the comments, I was asking my self if it would make sense to have the language as part of the Identity instead of the Application, normally the language is only relevant to the output which is a user interacting element.

This would be a bigger refactoring and is out of scope for this pr. But it actually makes sense to attach the language to a user object

Also I don't see the possibility to override/provide the language to an extension when booting it. For example to have the component in a different language then the current language.

Who wants to boot an extension with a different language? Mostly the extension itself has some logic to use a different language with a different locale while executing a controller task. From my experience a language with a different locale is only necessary when sending out mails for users with a different language set as the application language, but for this it is possible to inject a language factory and create a new language with a different locale. And when we on some point move the language from the app to the user, then we solve the majority of cases where a different language is used than the app language.

avatar MacJoom MacJoom - close - 14 Jun 2023
avatar MacJoom MacJoom - merge - 14 Jun 2023
avatar MacJoom MacJoom - change - 14 Jun 2023
Status Pending Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2023-06-14 19:53:59
Closed_By MacJoom

Add a Comment

Login with GitHub to post a comment