Add custom locale in Strapi Admin

Strapi has a predefined list of available locales. These locales can be selected for content translation. The available list is defined inside a JSON file available at this path of your strapi project:

node_modules/@strapi/plugin-i18n/server/constants/iso-locales.json

Within the settings for the internationalization plugin the admin UI would allow for selecting locales, as shown here:

Strapi Internationalization Settings

In case custom locales are required, e.g. for supporting special dialects, the JSON file could be edited and the admin UI needs to be rebuilt. In order to make this in a reproducible way, the patch-package node package can be used.

The following steps are required to achieve this:

Within the project folder of the strapi project a patches folder was created. This folder can be added to git. The postinstall lifecycle script inside package.json would be triggered on every npm install execution. This makes the chagnes in node_modules reproducible and by that the custom locales available inside the strapi admin.