Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Updated: Comment #0
Problem/Motivation
Field configuration does not yet have a UI for translation.
Proposed resolution
We would build the form, and add a Translate link from the field lists.
Remaining tasks
- Strategize
User interface changes
yes. add a ui for translating field config.
API changes
No.
Related Issues
(A list of related issues.)
Comment | File | Size | Author |
---|---|---|---|
#23 | 2028137-config-translation-field.instance-23.patch | 20.93 KB | vijaycs85 |
#23 | 2028137-diff-20-23.txt | 12.05 KB | vijaycs85 |
#20 | 2028137-config-translation-field.instance-20.patch | 8.48 KB | vijaycs85 |
#20 | 2028137-diff-14-20.txt | 7.4 KB | vijaycs85 |
#14 | 2028137-config-translation-field.instance-14.patch | 1.05 KB | plopesc |
Comments
Comment #1
YesCT CreditAttribution: YesCT commentedthis is a current field list.
we want to add a translate operation to the drop down operations.
Comment #2
Gábor HojtsySo I think the trick part is there is no global list of fields. There is one in Admin > Reports > Field list. But that does not have operations. So we should put in the translate operation into the lists for each entity. If those use entity list controllers (which they likely(?) don't) and if field configs are proper config entities then the translate operation would show up. We should still wire in the paths with the entity or config group mapper as appropriate.
Comment #3
vijaycs85Adding this few lines brings the overview page with list of issues
1. There is no tab/link in drop-down
2. Add link can't make {bundle} to correct value.
3. Still no add/edit/delete pages.
Comment #5
vijaycs85Removing debug code.
Comment #7
vijaycs85Updating {bundle} in URL.
Comment #8
vijaycs85Small code fix...
Comment #9
YesCT CreditAttribution: YesCT commentedThis is just my first read. Mostly asking questions so I can try and understand. :)
If there are other sections like this,
we should make the inline comments be sentences...
We could do that in the whole file in a clean up issue.
I (or someone) should check this patch in the context of the whole file. I'll do that, but just saving this for now.
the if, makes sure it's fieldable..
and also
that it has a route base path?
What is the second part of the condition mean in words?
what is an example of bundle that has a bundle prefix that needs to be removed.
is it like:
comment_node_article
has comment_node removed,
so we only use
article as the bundle?
ag bundle_prefix core
yields:
core/lib/Drupal/Core/Entity/Annotation/EntityType.php
222: public $bundle_prefix;
which says:
save what?
save the path pattern?
and looks like it updates $field_items, not $items.
How does saving it avoid duplicates?
add what to group info?
Comment #10
vijaycs85Thanks for the review @YesCT. here is some updates in #9.
#1 - ok
#2 - updated comment
#3 - Exact same lines are in entityManager::getAdminPath(). Trust me, I didn't copy :D
#4 & #5 no more exist because of #3 change.
Comment #11
YesCT CreditAttribution: YesCT commentedI checked the other sections are the same. So just leave this.
the foreach is gone, so now the code that is there should have indent corrected.
$path . '/fields/{...'
Gabor says we do concat with single quotes usually
Comment #12
YesCT CreditAttribution: YesCT commentedhttp://localhost/drupal2/admin/structure/types/manage/article/fields/nod...
do see the translate table. :)
The requested page "/admin/structure/types/manage/article/fields/node.article.body/translate/add/af" could not be found.
oh, and we have yet to add the code to make the translate operation show on the field drop buttons. so that does not work yet either.
Maybe the usual subjects for not working is:
the wrong url (like changing to manage url pattern),
or if the source file has langcode und we will get access denied [this is not happening here, but I'm writing down so I remember in case].
Comment #13
plopescWorking on this one...
Regards
Comment #14
plopescHello.
Attaching patch including YesCT suggestions in #2028137-11: Integrate field configuration translation on the user interface.
However, I'm not able to show the link or fix the not found page problem.
Regards
Comment #15
Gábor HojtsyComment #16
vijaycs85Seems we got a blocker #2035877: URL with more than 10 slashes is not working in new routing system
Comment #17
Gábor HojtsyUhm, hum, not very good :/
Comment #18
vijaycs85Seems #274270: Future of menu depth? has a history or would be a big change. not sure about the possibility of getting it in D8. May need to try for some alternative?
Comment #19
Gábor HojtsyI sincerely hoped the limit would go away with the switch out from the old routing system. If that switching out will not happen, then meh. Yeah, we need to find something else to solve this in that case.
Comment #20
vijaycs85Ok, attached patch addresses 3 items:
1. path for translation pages
- overview page has no change - [base path]/translate
- Add translation page changed from [base path]/translate/add/[langcode] to [base path]/translate?action=add&langcode=[langcode]
- Edit translation page changed from [base path]/translate/edit/[langcode] to [base path]/translate?action=edit&langcode=[langcode]
- Delete translation page changed from [base path]/translate/delete/[langcode] to [base path]/translate?action=delete&langcode=[langcode]
At least it resolves field translation page issues (for now).
2. Typo in comments \Symfony\Component\HttpFoundatio\Request to \Symfony\Component\HttpFoundation\Request
3. ConfirmFormBase change wasn't there. change of protected => public for 3 methods.
Comment #22
vijaycs85Yep, Test cases need to be updated as per current URL change...
Comment #23
vijaycs85- Updated all test cases to reflect the URL change
- Removing 'Needs test' as depth restriction is a known core issue.
Seems there are some issue with confirmFormBase (hope, not related to this change). So there is a possibility to get some fails, but not 60+ as we have in #20 :)
Comment #24
vijaycs85Green1!!! @Gábor Hojtsy are we OK to go with this approach for now?. We can roll back, if MENU_MAX_DEPTH removed from core
Comment #25
Gábor HojtsyYeah, this seems to be our only possibility. One thing I don't understand is why do the confirm form methods need to be public now all of a sudden. Other changes look good.
Comment #26
vijaycs85@Gábor Hojtsy, This change went in as part of 73fbcf80 commit on 17th June.
Comment #27
vijaycs85#23: 2028137-config-translation-field.instance-23.patch queued for re-testing.
Comment #28
vijaycs85Committed 4018bd1 and pushed to 8.x-1.x. Thanks!