Viewing 6 replies - 1 through 6 (of 6 total)
  • You should be able to change that by directly changing the string. The only way to change that text is to edit the translation file. Here is how to do that:

    1. Register here:
    https://www.transifex.com/projects/p/wysija/language/en_US/

    2. Download the .po file of your language.

    3. Download the software poEdit:
    https://poedit.net/

    4. Open the .po file with Poedit, change the translation of that string to your desired text.

    5. Upload the two generated files (.mo and .po) to wp-content/languages/plugins/ after you save them.

    Let me know if that helps!

    Thread Starter ThinaS

    (@thinas)

    Hi,

    thank you, but …
    I couldn’t register with your link, so I registered at transiflex.com and had 2 possibilities to choose. I guess I choose the wrong on – the translation. There I can add projects to be translated. And even with the search tool I can’t find .po files to download.

    Would you please post the link where I get the .po file

    But I don’t know, if that solves my problem.
    I don’t need a translation, I just need the possibility that when my newsletter is sent to a person which is registered as female (I’ve set that already) the greeting starts with “geehrte Frau” in front of her name.

    The greeting line should start with “Sehr” – that stays the same for male and female.
    – followed by “geehrte Frau” for female
    – or “geehrter Herr” for male
    – than follows there last name.

    What I need is, that “field:3” – which is my field to select between Frau/Herr – adds “geehrte” for Frau or “geehrter” for Herr – in the greeting line.
    My code:
    Sehr [field:3][user:lastname | default:reader]
    is shown as:
    Sehr Herr lastname
    I want:
    Sehr geehrter Herr lastname

    Best
    Tina

    Hey, i need this exactly too!!!

    function mailpoet_shortcodes_custom_filter( $tag_value ) {
    
        if ($tag_value === 'gender_filter') {
    		if( do_shortcode(  tribe_get_custom_field('field:6') ) == 'Frau') {
    			$replacement = 'geehrte Frau';
    		}
    		else if( do_shortcode(  tribe_get_custom_field('field:6') ) == 'Herr') {
    			$replacement = 'geehrter Herr';
    		}
        }
    
        return $replacement;
    
    }
    add_filter('wysija_shortcodes', 'mailpoet_shortcodes_custom_filter',10 ,2);

    i tried something like this but it doesn’t work and i must say i just know some basic of php

    Thread Starter ThinaS

    (@thinas)

    Hi

    I’m going the easy way now and not the elegant one.

    Sehr geehrte(r) [field:3 ][user:lastname | default:reader]

    But if one of you guys has THE solution it would be nice if you let me know.

    @r4be76: tribe_get_custom_field belongs to the plugin The Events Calendar (and is deprecated). It has nothing to do with MailPoet.

    @thinas, @r4be76: Try this:

    function mailpoet_shortcodes_custom_filter( $tag_value, $user_id ) {
        if ( $tag_value === 'gender_filter' ) {
            global $wpdb;
            foreach ( $wpdb->get_results( "SELECT cf_x FROM wp_wysija_user WHERE user_id ='" . $user_id . "'" ) as $key => $row ) {
                $gender_filter = $row->cf_x;
            }
            if ( $gender_filter === 'Frau' ) {
                $replacement = 'Sehr geehrte Frau';
            } else if ( $gender_filter === 'Herr' ) {
                $replacement = 'Sehr geehrter Herr';
            }
        }
        return $replacement;
    }
    add_filter( 'wysija_shortcodes', 'mailpoet_shortcodes_custom_filter', 10 , 2 );

    In cf_x you have to replace the x with the custom field number (two times).

    Use it like so and make sure the fields gender_filter and lastname are obligatory:

    [custom:gender_filter] [user:lastname]

    This is certainly not the best solution but it works.

    Credits to o.heinrich.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘German style of address’ is closed to new replies.