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.
Problem/Motivation
Translators have access to all routes from config_translation module but have no way to access them.
Proposed resolution
Add a UI for translators with all entity types and entities.
Remaining tasks
- Tests done in #2098675: Add missing tests for config_translation.mapper_list and config_translation.entity_list
User interface changes
API changes
Related Issues
Comment | File | Size | Author |
---|---|---|---|
#31 | config-translation-ui-2095145-31.patch | 23.55 KB | webflo |
#31 | config-translation-ui-2095145-27-31.interdiff.txt | 1.41 KB | webflo |
#27 | config-translation-ui-2095145-27.patch | 22.45 KB | webflo |
#27 | config-translation-ui-2095145-23-27.interdiff.txt | 2.79 KB | webflo |
#23 | config-translation-ui-2095145-23.patch | 20.97 KB | webflo |
Comments
Comment #1
webflo CreditAttribution: webflo commentedComment #3
YesCT CreditAttribution: YesCT commentedjust the current state. :)
admin/config
admin/config/regional/config-translation
admin/config/regional/config-translation/entity-type/block
admin/structure/block/manage/bartik.breadcrumbs/translate
Comment #4
webflo CreditAttribution: webflo commentedCompleted the list page for config entities and all bundles. Still needs proper page titles and tests.
Comment #5
webflo CreditAttribution: webflo commentedComment #7
webflo CreditAttribution: webflo commentedreroll
Comment #9
webflo CreditAttribution: webflo commentedreroll
Comment #11
webflo CreditAttribution: webflo commentedRe-roll and added the missing method in ConfigEntityMapper.
Comment #12
YesCT CreditAttribution: YesCT commentedI'm reviewing this.
Comment #13
Gábor Hojtsy#11: config-translation-ui-2095145-7.patch queued for re-testing.
Comment #15
YesCT CreditAttribution: YesCT commentedDid this review side by side with @webflo. Most of this was fixed *while* writing up the review. Posting the notes here for ... information.
Also, it was rerolled during the review. So some stuff is a bit different.
Patch coming, later.
related to #2003812: Reorder element under configuration => Regional and language we might want this lower? Let's make it last and set it to 30.
I looked for examples in core, the content types page is not called list, it is just called Content types.
This also helps the breadcrumb make sense..
So I think our title should be:
Configuration Translation
Also, looked for examples of what kind of path to use. and if it was ok to use config-translation (with the short config vs configuration).
In the UI we are careful not to use appreviations, but the url is OK I think.
For example, I looked at:
admin/config/development/sync (which has title Synchronize configuration)
we checked views_ui and content_type and they used in the route id, for the unique part, list or overview.
Let's use list. (instead of entity_index)
admin/config/regional/config-translation (mapper_index)
is a list/overview of
a) config entity types (except field instances)
b) field instances by entity type [because otherwise all fields were listed on one page, not grouped by entity type/bundle and it was confusing to see for example, body and also body and not know which entity type the body was for which one.]
c) plain configuration cmi pages
this makes the route for the config entities and for the field instances.
let's call the route id, entity_list (to match the list name we are using on the other, instead of entity_index.
----
title seems to be inherited from the parent.
let's dynamically set it to be the config mapper label.
needs a type.
@var .....
adding definitions argument.
add an @param for it.
needs a comment
something like:
get the config entity type label for the field instances to use in the listing because that what they are grouped by and is a good label for the group.
this is a suckky suggestion. reword.
----
also, should entityManager be injected?
in upcoming patch it will be , it will use the entityManager property that was added by #2085925: Autogenerate config entity translation mapping as much as is sane
this looks weird.
we have to get the parts because we are already getting the parts. but why get the whole thing then instead of just the extra parts you want?
maybe this was already discussed with Gabor
needs doc block.
add comment to explain why field instances get special treatment. but they may not always be field instances. others could extend this, set their own typeLabel and this will work to use whatever override they wanted to.
what is an example of something that does not have a label that we have to fall back on title for?
most of the time, I think I see a call to parent first, then add stuff.
@webflo says though, calling parent here makes no sense. we will not have any other operations.
if parent was called. then it would get a translate operation and we would have to then remove that.
ok. we just want list here.
where needed?
huh? there was another getTypeLabel that defaulted to title.
we extend this class and override it there.
a comment here explaining why we want to remove operations we got from the parent would be good.
wait. why not just not call the parent and just add operation? Oh because we are not adding translate operation. they are already there and we would not know exactly how to set it anyway for all the different things.
ok.
since we are adding all these new anyway... alpha order is nice.
these all need doc blocks, and types (@var)
adding a new param, instead of inheritdoc, copy from the parent and add your new @param.
add comment explaining that that page, user for example, would have the title user, all rows would always list the user bundle in the bundle column so this tried to take out that column.
this looks complicated.
comment please about why we do this.
the mapper list/list/overview, the items are grouped, and in the groups are ordered by whatever getMappers returns.
the mappers get returned all together is some order. the mappers define a weight for themselves (MapperType, in new patch will be a weight).
items in the overview are sorted by weight. then no sort, just whavever order.
I think they should be in alphabetical order by their config entity type label.
I think this could use a comment explaining why it is going in a two dimensional array, grouped by type/weight.
needs doc block.
needs doc block.
Maybe one with a nice extra paragraph explaining the why and what of how the page is being build here, with an example described of entity types and couple field instances.
add comment here.
it is making a flat array because now the order is right. but the thing we have to return needs to be a one dim array.
then we ran out of time and were tired of doing it. so most of the rest just needs docs. :P
Comment #16
Gábor HojtsyDo we have a list of which ones still need fixing?
Comment #17
webflo CreditAttribution: webflo commentedIntegrated the changes from comment #9.
This could be done in a follow-up. I think it makes sense to pass the complete plugin definition to the constructor instead of single array values. The current array values are scalar value we can use type-hinting anyways ...
I removed getMapperById because mappers are now plugins. And the plugin Manager has this feature already build in.
Comment #18
webflo CreditAttribution: webflo commented+Needs usability review
Comment #19
webflo CreditAttribution: webflo commentedHere is a proper interdiff for the patch in comment #17
Comment #20
webflo CreditAttribution: webflo commentedreroll
Comment #21
YesCT CreditAttribution: YesCT commentedTitles fixed. :) (I want to re-read through the whole comment #15 next and the code)
----
----
We discussed and decided to mix the entities and field instances, and sort within that (and other lists) alphabetical by label.
After that I think this is ready for @Bojhan to look at after the sorting.
Comment #22
YesCT CreditAttribution: YesCT commentedthe second line is supposed t be the type.
classes have newline before last }
needs type
seems like we should type hint definition.
a all^all
does not always show it.
maybe
Controls showing the bundle..
add a description.
explicitly
At this point we have 1 or 0 bundles. If we showed the bundle and the entity type name and they were the same, it would be repeated everywhere and not add info. so only show it if it does not match.
typo: ones not match
should be:
does not match
if only considering core right now, the default to not show the bundle only happens for user.
needs description line too.
needs to be one line summary 80 chars or less.
a mapper
@param needs a type.
both need descriptions.
Comment #23
webflo CreditAttribution: webflo commentedApplied the changes from comment #22. And sort the mapper list by label. We decided to sort the entity list alphabetically. But this change is not yet in this patch. I fix it tomorrow.
Comment #24
Gábor HojtsyGO testbot.
Comment #25
Gábor HojtsyI'd love to commit this sooner than later. If we can prioritize this and make it happen sooner than other patches, we can get this nice list UI in.
Comment #26
Gábor HojtsyComment #27
webflo CreditAttribution: webflo commentedThis patch fixes the sort order mentioned in #23. Lists config entities in in alphabetical by default and FieldInstances by bundle and label.
Comment #28
Bojhan CreditAttribution: Bojhan commentedThis probably needs a lot more context, whenever I land on the page I have no idea what I am looking at. Some useful help text would be useful. I also am confused that it feels like the only way into those settings, when its not - you can just get there through the entity too.
Other issues I noted:
- Translating a config thingie isn't responsive at all.
- There is no clear indication whether the left or right is the source language other than seeing the text boxes.
Comment #29
webflo CreditAttribution: webflo commentedHow about ..
Comment #30
Gábor HojtsyReviewed with @Bojhan:
Also looked at the language listing page and the translation page, and figured a help text would not help much there. The pages are pretty evident. So this is it.
Comment #31
webflo CreditAttribution: webflo commentedAdded the help text from #30
Comment #32
Gábor HojtsyYay, committed! This still needs tests, but that can be a followup in our case. It will not be committed to core anyway without that :D
Amazing work, thanks!
Comment #33
tstoecklerSorry for the spam, but webflo+++++++++++
Comment #34
YesCT CreditAttribution: YesCT commenteddo we have an issue open for the tests yet?
what specifically should we test?
Comment #35
YesCT CreditAttribution: YesCT commentedmaybe this is it? #2098675: Add missing tests for config_translation.mapper_list and config_translation.entity_list
Comment #36
webflo CreditAttribution: webflo commentedYes, this issues is covered with the tests from #2098675: Add missing tests for config_translation.mapper_list and config_translation.entity_list
Comment #36.0
webflo CreditAttribution: webflo commentedadded possible followup not sure if it is the correct one.
Comment #38
Gábor HojtsyRetroactively tagging.
Comment #38.0
Gábor Hojtsyno more todos.