These triggers ensure that if an alias is set to primary_for_locale = true, we unset primary_for_locale on all other aliases for that locale & entity to avoid uniqueness violations on the *_alias_idx_primary index.
There's a major problem here: cascading triggers do not mix well with dbmirror, and can break replication. This is because when row-level AFTER triggers are cascaded, the innermost recordchange trigger is run first (inverse of the actual statement order). This is exactly what caused
MBS-9366, and is a very hard problem to fix in dbmirror properly; it's much safer to outright ban cascading updates on replicated tables.
Even ignoring the replication issue, we don't need these triggers. Avoiding duplicate primary locales can be handled by the application (and already is). If it wasn't, it even seems better to have the application fail with a unique index violation (since that indicates it's not accounting the changes properly) than silently change the data.