Open klonos opened 8 years ago
Yes, it would be good to have it configured and setup automatically if any additional language is added to a website. I was lost and disappointed at the first stage before @klonos helped and explained me the solution.
Anyways, how would something like this be possible? Update hooks?
We could modify the admin/content/node
view in a hook_install()
in translation.install
. However, automatically modifying a view seems like it could be slightly risky, as that view may have already been modified manually. We can check if the view is still in its default state, but /sometimes/ modifying the view and sometimes not seems worse than just always modifying it.
I think it'd be reasonably safe overall though, it's an admin-only view and you're likely to be turning on major modules like translation reasonably early in the development of a site.
How about adding a display (called "multilingual content" perhaps) with the additions to the original view and making that one active? Would that be "safer"? ...and more importantly, can it be done?
In #1574, while helping @bd0bd out, I saw that it was not clear to him (average new Drupal/Backdrop user coming from another CMS) why he could not filter the available content by language. This page is generated by a view and the process of adding the content language as a field and a filter criterion is pretty straight-forward for a views ninja, but obviously not to new users.
Wouldn't it make sense to have the view automatically updated to include the "Content: Language" field and a respective exposed filter once the user added a second language to their site? My only concern is how we should handle the reverse operation (if the user removed all but a single language from their site). Would we want to remove the filters from the view?
Anyways, how would something like this be possible? Update hooks?