• The text field BOOKACTI_PLUGIN_NAME after the sentence that needs to be translated does not have single quotes and cannot be translated at all.
    For example: BOOKACTI_PLUGIN_NAME in __( ‘Booking number’, BOOKACTI_PLUGIN_NAME ) needs to be enclosed in single quotes to be translated.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author yoancutillas

    (@yoancutillas)

    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.www.ads-software.com/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?

    Plugin Author yoancutillas

    (@yoancutillas)

    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

    Plugin Author yoancutillas

    (@yoancutillas)

    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

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Translation problem’ is closed to new replies.