Find solution for explicit localization when using the document manager
- Dominant language
- PHP
- Stars
- 181
- Forks
- 102
- PR merge metrics
- No merged PRs in 30d
Description
The document manager currently has one localization aware method - `findTranslation`, which is the localized analogue of `find` There does not exist an analogue for ``findMany` and the query builder does not support localizing results.
Other methods that could be localized:
- `getReferrers`
- `getReference` (?)
- `getChildren`
- `getDocumentsByPhpcrQuery`
Repository classes also have methods which could be localized.
Possible solutions
- Do nothing and deprecate `findTranslation`: The user must change global state by changing the locale of the locale chooser.
- Make the DocumentManager localizable through a `localize` method which returns a localized clone of the DocumentManager.
- Add explicit translated methods: `getTranslatedReferrers`, `findTranslatedMany`
- Add additional, optional, `$locale` argument to all existing localizable methods.
Contributor guide
Assessment
This issue has not been assessed yet.