getgrav / getgrav/grav-plugin-admin

Removing a Multilang language should delete translations

Open
#2,426 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
PHP
Stars
377
Forks
225
Avg merge
11h 51m
Merged PRs (30d)
4

Description

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:

1. 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.
2. When listing languages in the Pages dropdown, if a language is defunct, show the language option as disabled or just omit it entirely.
3. 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.
4. Include a "Purge unreacable translations" button somewhere

Contributor guide

Open the contributing guide

Research direction

Start by tracing how the Configuration page saves the language list and how the Pages dropdown discovers translation files. The issue presents several possible solutions rather than a selected scope; done should be defined by the maintainer, then verified for removed-language cleanup and handling of existing translations.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend, content
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.