Follow the system's 12h or 24h time format setting
There is no standardized way to do that but we can at least try to access the corresponding GNOME setting to do it with ashpd.
See the portal example at: https://bilelmoussaoui.github.io/ashpd/ashpd/desktop/settings/index.html.
We need to watch for changes in the setting so we can update the strings that depend on it. If we can't access the portal, I believe we should use the locale's default, as we do today.
See also GNOME Clocks' implementation: GNOME/gnome-clocks@01eb5f03.