I have developed seven Wordpress plugins for a new project as I was not able to find anything that currently supported these features. Three of them have interest from other users and one of those other users runs a multi-language multi-site.
I'm therefore looking at internationalisation. I have reviewed the documentation here but am at a loss. https://developer.wordpress.org/themes/functionality/internationalization/
Firstly many plugins I have downloaded from the Wordpress.org do not contain a text-domain for the plugin contrary to what is stated here. Secondly, some of these plugins also use react components.
My preference is not to bother directly translating strings myself based on different locales but to allow the system to do it for me (assuming it supports it). There is nothing complicated about any of these strings as they are mostly just input labels.
So what is the correct approach:
<?php echo __('Enter a title'); ?> or
<?php echo __('Enter a title', $plugin_name); ?> or neither.
And in react
__("Enter a title") or
__("Enter a title", plugin-name) or neither.
And I also read something about not using variables for the text domain in these internationalisation strings. Does that mean they need to be hard typed in every single place.