Hello,
BOOKACTI_PLUGIN_NAME is not meant to be translated.
It’s a PHP constant for Booking Activities text domain (documentation).
The text domain is an ID telling WordPress where it should look for translations. For example: __( ‘Booking number’, BOOKACTI_PLUGIN_NAME ) means: look for ‘Booking number’ translation in Booking Activities translation files.
You can officially translate Booking Activities here:
https://translate.wordpress.org/projects/wp-plugins/booking-activities/
Or make your own private translation:
Open the following file with POEdit:
wp-content\plugins\booking-activities\languages\booking-activities.pot
Make your translation. And save the translation files here:
wp-content\languages\plugins\booking-activities-xx_XX.mo
wp-content\languages\plugins\booking-activities-xx_XX.po
where xx_XX is your locale code.
Regards,
Yoan Cutillas
Thread Starter
秦朝往事
(@kzgzs)
Yes, BOOKACTI_PLUGIN_NAME should not be translated, but it should be enclosed in single quotes: __( ‘Booking number’ , ‘BOOKACTI_PLUGIN_NAME’ )
Can refer to other plug-ins to be translated, is there a single quote?
Hello,
BOOKACTI_PLUGIN_NAME is not the text domain itself, it is a constant. A constant is like a variable, it holds a value.
In that case,
BOOKACTI_PLUGIN_NAME = ‘booking-activities’
This is defined in booking-activities/booking-activities.php line 44.
When your server reads the code, it doesn’t read
_( 'Booking number', BOOKACTI_PLUGIN_NAME )
It reads
_( 'Booking number', 'booking-activities' )
This should not be a problem for translation,
Can you describe what you are trying to achieve? I may help you find a way
Regards,
Yoan Cutillas
Hello,
Just a note to let you know that the PHP constant BOOKACTI_PLUGIN_NAME has been replace by the string 'booking-activities' since 1.7.8.
Indeed WP-CLI i18n make-pot doesn’t recognize the PHP constant while parsing the files. Now we can easily generate a .pot thanks to it.
Note that the Booking Activities .pot file is included in the plugin, in the /languages folder.
Regards,
Yoan Cutillas