Adding custom ISO Code for language dialects

In German we have many dialects and subdialects etc. I want to build a system for a linguistic use case, were content objects should be translated into dialects. Therefore I would like to add custom ISO codes to the ISO Locales JSON File.

Does anybody has an idea how to do that?

The only reasonable approach seems to be editing the JSON file and making this change reproducible with patch-package. I documented the approach here, for anyone who has a similar requirement.