-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
EZP-27539: Translation support in content edit #182
Conversation
e748e24
to
6276945
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me besides a few comments.
@@ -103,7 +103,7 @@ public function createWithoutDraftAction($contentTypeIdentifier, $language, $par | |||
|
|||
return new ContentCreateView(null, [ | |||
'form' => $form->createView(), | |||
'languageCode' => $language, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might not be critical, but maybe I'd try to keep some BC here: add language
, and comment languageCode
as deprecated ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure. 2.0 will change a lot actually, I'd love to make it as clean as possible in 2.0 so that we aren't left with a lot of deprecations till 3.0. I believe it's just a matter of writing a descriptive doc on what is not backwards compatible.
@@ -153,7 +156,12 @@ public function processCreateDraft(FormActionEvent $event) | |||
*/ | |||
private function saveDraft(ContentStruct $data, $languageCode) | |||
{ | |||
$mainLanuageCode = $this->resolveMainLanguageCode($data); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo on $mainLanguageCode
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Argh, happens to me on word language constantly ;)
*/ | ||
private function resolveMainLanguageCode($data): string | ||
{ | ||
return $data->isNew() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we be a tiny bit protective and test the type of $data
, since we don't have typehinting here ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea. Fixed.
5ea6a2a
to
673bcbd
Compare
673bcbd
to
62e2800
Compare
Description
Translation support was never implemented in repository-forms. Now there is a need for that in new AdminUI. This PR makes fieldtypes "language" aware which is helpful for developers theming content edit page. It also fixes the issue of nontranslated labels of fieldtypes as this feature is there but never implemented in Admin UI or Platform UI.