@pavelmares thanks for your issue – good issue 🙂
I spent a lot of time to fix this…
But the problem is on the side of the Polylang plugin.
Polylang string registration function does not support the domain:
pll_register_string
[@param string $context Optional, the group in which the string is registered, defaults to 'polylang'.
]
This optional $context is not the same as context in the class Translations (from WordPress core):
Translations()->translate( $singular, $context = null )
In Translations context means the domain of the text.
To fix this I need to make changes inside Polylang plugin- I think.
In summary, Polylang plugin does not support domains in text translations from the admin panel.
So when there are mixed strings like __( ‘string’, ‘my-theme’ ); and __( ‘string’, ‘wordpress’ );
In Polylang translations there will be one and the same but the “wordpress” wins because it is first loaded.
Yes exactly.
I tried to implement this in my plugin, but I failed to do that.
This is an interesting problem. Perhaps I need to read more code of the Polylang plugin and find some filter or action to fix this?
But I need more time 🙁