grav
grav copied to clipboard
Removing a Multilang language should delete translations
This is perhaps a niche case, since you would rarely want to drop an entire language from your site, BUT it is a stumbling block for anyone using the Multilang skeleton.
The skeleton comes with nine languages supported, and this is most likely not the list of languages the user wants. So they go into Configurations and changes the list of languages to, say, en
and da
, then hits Save.
Now they open the About page and try to switch to the da
version. The dropdown will now list Danish as an option, but also all the now-defunct language options (since the files like 02.about/page.es.md
are still there). Clicking on the others will redirect to a 404 page, and there is not way to remove them from the Admin panel.
There are a few ways this could be made more intuitive:
- When changing languages in the Configuration page, show a warning "You have removed the languages (Espanol, Deutsch). This will delete all the associated content translations. Continue?". If they continue, delete the files. This seems like the most intuitive solution to me.
- When listing languages in the Pages dropdown, if a language is defunct, show the language option as disabled or just omit it entirely.
- If a user chooses a defunct language in the dropdown under Pages, populate the content/options etc. fields, but display a message saying the language is disabled, and include a "Delete translation" button.
- Include a "Purge unreacable translations" button somewhere