We have a problem with String translations. When we use a custom string domain on some custom templates (pages, posts...), some translations of strings in random languages disappear from the front end. However, when we check the string translations, the translations are still there, but they are not showing on the front end. The issue can be fixed by saving the affected string translation again. Usually, multiple string translations disappear from the front end and revert to the default English language. However, when we save just one string translation from the same domain, it fixes all the missing translations that are part of that custom string domain.
We are unable to identify what is causing this problem, as it happens randomly without any specific pattern. I have tried to replicate the issue by adding new translations, removing them, and adding new strings to translate in that domain, but I have had no luck in reproducing it. Currently, we don't have any problematic strings, but they might appear again soon. Do you have any idea what could be causing this issue?
I suspect it might be a conflict in how the string translations are being saved to the database, possibly due to our large database size, which is causing it to stop working for custom strings.
This sounds a strange problem while I believe if you are using proper text domains and gettext calls, it shouldn't happen.
However, assuming that this is happening in your custom theme, I'll recommend trying to set these domains in WPML -> Theme and plugins localization -> Theme and plugins localization -> Automatically load the theme's .mo file using 'load_textdomain' option (see attached).
Also make sure these strings are "included in string translation" via "Translate text in admin screen" (hidden link), in case if these appear in admin texts.