translation problem

Home Forums Calendar Products Community Events translation problem

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #1095332
    Henry
    Participant

    Through the event-tickets-plus-nl_NL.po i can translate the fields.

    But not the “Don’t list me on the public attendee list”
    I’ve found it in the source code and i can see it uses the language from the “non plus ticket version”.

    So i checked the language file of the “non plus version” but also there i could not find this in the po file.

    I decided to alter the php code and change the text in the php file. but that didn’t work.

    How can i translate “Don’t list me on the public attendee list” to dutch?

    • This topic was modified 10 years, 1 month ago by Henry. Reason: added some tech info
    #1095344
    Brook
    Participant

    Howdy Henry,

    I would love to help you with this. Are you include the \ in your translation match string? The full text for the string that needs to be translated is:

    Don\’t list me on the public attendee list

    Notice how there is a slash preceding the ‘ mark. It’s possible your translation tool is stripping this out. Honestly we probably should not have included that \ in our text to being with, it’s making this more difficult.

    If the above doesn’t work, you could certainly translate it using this snippet:

    [php]

    /*
    * EXAMPLE OF CHANGING ANY TEXT (STRING) IN THE EVENTS CALENDAR
    * See the codex to learn more about WP text domains:
    * http://codex.wordpress.org/Translating_WordPress#Localization_Technology
    * Example Tribe domains: ‘tribe-events-calendar’, ‘tribe-events-calendar-pro’…
    */
    function tribe_custom_theme_text ( $translations, $text, $domain ) {

    // Put your custom text here in a key => value pair
    // Example: ‘Text you want to change’ => ‘This is what it will be changed to’
    // The text you want to change is the key, and it is case-sensitive
    // The text you want to change it to is the value
    // You can freely add or remove key => values, but make sure to separate them with a comma
    $custom_text = array(
    ‘Don\’t list me on the public attendee list’ =>’new text here’
    );

    /if((strpos($domain, ‘event-‘) === 0 || strpos($domain, ‘the-events-‘) === 0) && array_key_exists($text, $custom_text) ) {
    $text = $custom_text[$text];
    }

    return $text;
    }
    add_filter(‘gettext’, ‘tribe_custom_theme_text’, 20, 3);[/php]

    Does that all make sense? Will that work for you? Please let me know.

    Cheers!
    – Brook

    #1096343
    Henry
    Participant

    in plugins/event-tickets-plus/src/views/wootickets/tickets.php
    on line 109:
    esc_html__( ‘Don\’t list me on the public attendee list’, ‘event-tickets’ ) .

    I had to add -plus at the end of “event-tickets” to point to the right translation file where “don’t list me on the public attendee list” is present in.

    I changed it to this:
    esc_html__( ‘Don\’t list me on the public attendee list’, ‘event-tickets-plus’ ) .
    And now it picks up the dutch translation.

    Maybe a tip for you guys to change this in the source code;

    #1096381
    Brook
    Participant

    Thanks for getting back Henry.

    That string is actually used in two places, one in the location we’ve discussed and the other here: event-tickets/src/views/tickets/rsvp.php:125 Since as you can see it is used in the base Event Tickets plugin the same string is shared between it and the Plus one. If it’s translated in the base plugin file it will translate with Plus active as well. Thus to cut down on the amount of translation, that string and any other shared ones are part of the ‘event-tickets’ text domain. To translate those strings without modifying the plugin you should refer to this file: event-tickets/lang/event-tickets-nl_NL.po or even better checkout the WordPress.org community’s translation site where you can contribute translations for all users that will be included in the next release of the plugin.

    Let me know if you have any questions about the above. Sorry for the confusion.

    Cheers!

    – Brook

    #1103063
    Support Droid
    Keymaster

    This topic has not been active for quite some time and will now be closed.

    If you still need assistance please simply open a new topic (linking to this one if necessary)
    and one of the team will be only too happy to help.

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