Skip to main content

benecaster_supported_locales_updated

Action Free

Fires after the supported locales list and primary locale are saved in Settings. Use it to clear whatever your add-on caches per language.

What core already does on this action, so you do not repeat it: it refreshes the per-locale template sync admin notices, republishing or deleting them to match the new locale set. That is the whole of it.

Those notices are the only locale-keyed cached artefact in core. The feed cache is keyed on show, tier and timestamps; email templates are resolved per render, not cached per locale. Nothing else in core goes stale when the locale set changes. If you cache anything per language, clearing it is yours to do — core has no way to do it for you.

This fires on EVERY save, including one that changes nothing. An operator who opens the language settings and clicks Save with no edits still triggers it. Compare $supported against $previous_supported before throwing away a warm cache — otherwise a no-op save costs you a full rebuild. The previous values are passed for exactly this reason: the difference is what makes a one-time backfill for a newly added language cheap, instead of rebuilding everything every time.

Parameters

Name Type Default Description
$supported string[] New array of supported locale codes
$primary string New primary locale code
$previous_supported string[] Previously stored supported locale codes
$previous_primary string Previously stored primary locale code

Need this built rather than just documented? See our services →