• Resolved wp_smith

    (@wp_smith)


    Hi,

    I just found out, that there’s a new translation-parameter called msgctxt.
    It’s being used by new translation-functions like

    • _x(); (unique string?)
    • _ex(); (multiple occurence of one string?)
    • _nx(); (multiple different strings?).

    The normal translation-function __(); does not expect the msgctxt-parameter.

    Now the problem:
    The normal __();-function is used in searchform.php, but the .pot, respectively .mo-files are offering msgctxt-values at this point.
    The problem only occurs in searchform.php at 4 places.

    This modification of the code, using the new functions and values (at least) worked for me (no guarantee for 100% correct syntax):

    (msgctxt is the second parameter)

    <form role="search" method="get" class="search-form" action="<?php echo esc_url( home_url( '/' ) ); ?>">
    	<label>
    		<span class="screen-reader-text"><?php apply_filters( 'generate_search_label', _ex( 'Search for:', 'label', 'generate' ) ); ?></span>
    		<input type="search" class="search-field" placeholder="<?php echo apply_filters( 'generate_search_placeholder', _x( 'Search &hellip;', 'placeholder', 'generate' ) ); ?>" value="<?php echo esc_attr( get_search_query() ); ?>" name="s" title="<?php apply_filters( 'generate_search_label', _ex( 'Search for:', 'label', 'generate' ) ); ?>">
    	</label>
    	<input type="submit" class="search-submit" value="<?php echo apply_filters( 'generate_search_button', _x( 'Search', 'submit button', 'generate' ) ); ?>">
    </form>

    Hope it helps 🙂

Viewing 1 replies (of 1 total)
  • Theme Author Tom

    (@edge22)

    Thanks a lot for this! I’ve updated this file and it will be live in the next update.

    Thanks again 🙂

Viewing 1 replies (of 1 total)
  • The topic ‘generatepress.1.2.2 — wrong translation-functions in searchform.php’ is closed to new replies.