Problem/Motivation
Currently we allow to configure content language settings only for translatable entity types, but this is an unnecessary limitation, since language assignment settings apply also to language-aware but non-translatable entity types. Follow-up of #2230637-88: Create a Language field widget and the related formatter.
Proposed resolution
Display all language-aware entity types on the content language settings page. Remove workarounds from aggregator.
Remaining tasks
Review. Commit.
User interface changes
When language module (and for this screenshot aggregator) is enabled:
When content translation is also enabled:
API changes
None.
Beta phase evaluation
Issue category | Bug because non-translatable types cannot be configured for language defaults on the common configuration screen. Even for their own one-off configuration screens need workaround to work see http://cgit.drupalcode.org/drupal/tree/core/modules/aggregator/src/FeedF.... |
---|---|
Issue priority | Major because this affects all non-translatable language-aware entity types in core and contrib. |
Prioritized changes | Prioritized because this reduces fragility by allowing to remove one-off workarounds and improves user experience by removing a confusing and unnecessary differentiation. |
Disruption | No disruption foreseen. |
Comment | File | Size | Author |
---|---|---|---|
#43 | 2397729-language-aware-content-settings-43.patch | 5.23 KB | penyaskito |
Comments
Comment #1
plachBetter waiting for #2143729: Entity definitions miss a language entity key to be committed, as it will provide a way to code a cleaner solution.
Comment #2
plachThis is the draft patch provided in #2230637-88: Create a Language field widget and the related formatter.
Comment #3
plachNow for reals :)
Comment #4
plachWe will need to check that the
langcode
entity key is defined. Adding an API function/method to do that would be nice.Comment #5
plachFixed beta-phase evaluation.
Comment #6
plachComment #7
Gábor HojtsyI'd much rather display N/A in place of the checkbox instead of messing with where the columns are. We worked so hard on lining up the columns so you can take a quick look and see what is going on. Not including the translatable column for some while including for others seems to be a problem to me.
Comment #8
plachWell, that was a very raw draft: we could also add some CSS styling to align columns again, actually this is what I'd do if I didn't read #7, but no strong preference really.
Comment #9
Gábor HojtsyOne thing I would clearly avoid is using disabled checkboxes, that would be a disaster. Disabled checkboxes are in most cases impossible to tell apart from enabled checkboxes on many systems.
Comment #10
plachAgreed :)
Comment #11
alexpottI agree with the beta evaluation - reducing fragility and making things less hacky for contrib should be permitted if the disruption is minimal.
Comment #12
plach@alexpott:
Thanks for the feedback! I'd leave this postponed on #2143729: Entity definitions miss a language entity key, so we can rely on the
langcode
entity key to determine whether an entity type is language-aware.Comment #13
plachForgot to change status...
Comment #14
penyaskito#2143729: Entity definitions miss a language entity key landed.
Comment #15
plachWe have a patch, so setting NR for the bot, but it's NW actually.
Comment #16
plachGreen, nice :)
Comment #17
Gábor HojtsySo looks like this will need to be updated for the langcode key. @plach / @penyaskito? :)
Comment #18
penyaskitoLike this?
Comment #19
Kristen PolShould there be parantheses? e.g.
Comment #20
Kristen PolI do see the Aggregator and File entities in the list.
I don't know how to test the File (I didn't see an edit form for File) but I see language selector on the Aggregator Feed:
Comment #21
Gábor HojtsyAs discussed before this does away with all our work to line up things... See #7. I think we should display 'N/A' for translatable when it is not applicable or something similar. Code-wise it looks good.
Comment #22
plachOr using a multiple colspan.
Comment #23
Gábor Hojtsy@penyaskito: can you bring this forward?
Comment #24
penyaskitoAdded N/A.
Comment #25
penyaskitoComment #26
Gábor HojtsyYay, looks great, thanks @penyaskito.
We use the same N/A in the language summary table for English if English is not possible to translate. So this is very consistent. Needs tests to ensure that eg. File appears on
admin/config/regional/content-language
both before content translation module and after and then it does not have a checkbox.Comment #27
plachYep, looks great, @penyaskito++
Comment #28
Gábor HojtsyNeeds works for tests only then :)
Comment #29
plachWe should alse revert the changes introduced in the aggregator feed (or item?) form in #2230637: Create a Language field widget and the related formatter.
Comment #30
Gábor HojtsyI digged that up to make it easy. Looks like the whole method can go away now.
Comment #31
andypostis this used?
moved for no reason
use $entity->haskey()
Comment #32
Gábor HojtsyResolving #29/30 and #31. Still needs tests, feel free to work on that. ContentTranslationSettingsTest can be extended to test that the file entity appears for example. and has no checkbox for translation.
Comment #34
Gábor HojtsySo FeedLanguageTest fails on no langcode field where expected...
Comment #35
Gábor Hojtsy@penyaskito: wanna keep this going? :)
Comment #36
penyaskitoBack to green.
Comment #38
penyaskitoThis should be enough, easier than I thought.
Comment #41
Gábor HojtsyRetirled as a bug. Adding updated screenshots to summary, and updated summary in general.
Comment #42
Gábor HojtsyLooks good, except this tiny thing:
This is precisely NOT translation but language selection, right? :)
Comment #43
penyaskitoRight, the comment was wrong.
Comment #44
Gábor HojtsyYay, thanks!
Comment #45
alexpottNice patch, nice test, nice screenshots. Committed a85e59d and pushed to 8.0.x. Thanks!
Thanks for including the beta evaluation in the issue summary.
Comment #47
plachWoot
Comment #48
Gábor HojtsyAmazing, thanks all for your great work.