[Forwardport] Move functions.php into Framework #17960
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Original PR: #16800
Description
functions.php provides the custom Magento function __() to trigger translations. For some unknown reason this file lives under app/code. As such it is only distributed via the full magento distribution package. This in turn makes it a lot harder for developers to work with Magento in a modular fashion.
Ideally I want to be able to run .
composer require magento/framework .
run my unit tests
Due to __() only being available in the complete distribution I need to require all of Magento for 1 single file. A difference of 100+ modules.
I currently do not see any rationale for why this file is not part of any module. This PR proposes to move it into the Framework module. It also simplifies the bootstrapping processing as this file can be autoloaded. Happy to move it into any other module if desired.
Fixed Issues (if relevant)
N/A
Manual testing scenarios
install Magento
install any language pack, for example composer require splendidinternet/mage2-locale-de-de
enable locale and ensure translations still work
Contribution checklist