Delete a page in a specific language

We run a multilanguage site. Our client wants the ability to remove languages from certain Pages.
Page->delete() does not take language as a paremeter. How would be approach deleting languages from a Page?

What exactly do you mean? Remove existing translations from the content folder? What is the desired result/behavior?

In any case, this cannot be done from the Panel without a custom button or so.

Hello

Our site supports multi-languages. What is happening is, our client has created a page that is a framework for promotions, and they are duplicating this page, to create new promotions. This page is in English (main language), German, Spanish, Norwegian, Finnish, etc.

The new promotion page may not need to be in Spanish, and in this case, we want to remove the Spanish content from this page.

The Page Delete method targets the Page and all its languages. We just need to delete the single language and keep the page.

We are now thinking of using the DIR class and leveraging that to remove the Spanish file associated with the Page. But doing this we will need to build a custom plugin to add this feature onto pages.

Is there a way we can extend the Page delete to support this need or do you have other suggestions on how we can do this?

regards

It would probably make the most sense to do this in a page.duplicate:after hook so that it doesn’t affect normal page deletion.

Or add a Janitor button to the page with a custom action: GitHub - bnomei/kirby3-janitor: Kirby 3 Plugin for running jobs like cleaning the cache from within the Panel, PHP code, CLI or a cronjob