Support community for TTG plugins and products.
NOTICE
The Turning Gate's Community has moved to a new home, at https://discourse.theturninggate.net.
This forum is now closed, and exists here as a read-only archive.
You are not logged in.
Pages: 1
Look under Publisher Settings with the other Search settings
Rod
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site
Offline
Hi Rod,
thank you for the hint. That helps for the album search. I translated the theme before the 1.2.2 update.
Edit: I tried to gather the intl-strings once more but that didn't work. “Search blog" didn't appear in the.pot file.
For blog search I found the string <?php echo _x( 'Search Blog', 'submit button', 'pangolin-template' ); ?> in search form.php.
The string "Search Blog“ does not appear in the language file.
Might it help to change the “_x(" to "__(" and have the .pot rebuilt?
Cheers
Michael
Last edited by michilge (2017-07-23 11:42:37)
Offline
Try changing "echo _x" to just "_e".
Offline
I tried again. It can stay "echo _x".
But I changed the plain words "Search Albums" to "<?php echo __( 'Alben durchsuchen', 'pangolin-template' ); ?> " and translated again. The whole thing now reads as below.
Now I get the translated handoff string below the search input.
But when I reexport the theme from Backlight it will be overwritten.
<form role="search" method="get" class="search-form" action="<?php echo esc_url( home_url( '/' ) ); ?>">
<p>
<label><span class="screen-reader-text"><?php echo _x( 'Search for:', 'label', 'pangolin-template' ); ?></span></label>
<input type="text" class="search-field" placeholder="<?php echo esc_attr_x( 'Enter search, hit Return...', 'placeholder', 'pangolin-template' ); ?>" value="<?php echo get_search_query(); ?>" name="s" />
</p>
<button type="submit" class="fa_pseudo"><span><?php echo _x( 'Search Blog', 'submit button', 'pangolin-template' ); ?></span></button>
</form>
<form role="search" action="/backlight/search" method="GET" class="search-handoff">
<input type="hidden" id="q" name="q" value="" />
<button type="submit" class="fa_pseudo"><span><?php echo __( 'Search Albums', 'pangolin-template' ); ?></span></button>
</form>
<hr />
Last edited by michilge (2017-07-23 15:27:24)
Offline
I see the problem. Change:
<button type="submit" class="fa_pseudo"><span><?php echo __c('TEXT_SEARCH_ALBUMS_BUTTON', 'Search Albums') ?></span></button>
To:
<button type="submit" class="fa_pseudo"><span><thp> _e( '<?php echo __c('TEXT_SEARCH_ALBUMS_BUTTON', 'Search Albums') ?>', 'submit button', '<?php echo $template->getIdentifier(); ?>' ); </thp></span></button>
Offline
I had to make another change to make 'Search Albums' appear in the language template. It is now:
<button type="submit" class="fa_pseudo"><span><thp> echo _x( '<?php echo __c('TEXT_SEARCH_ALBUMS_BUTTON', 'Search Albums') ?>', 'submit button', '<?php echo $template->getIdentifier(); ?>' ); </thp></span></button>
To make this clear for other users, the change was made in the file backlight/modules/pangolin-wordpress/dynamic/view/searchform.php which is the pattern, backlight uses when the theme is exported to Wordpress.
Thank You
Michael
Offline
So using "_e" wouldn't show up for localization? You had to use "echo _x" instead?
Offline
The "echo " was missing. I copied "echo _x" from the 'Search Blog' instance from further up in the file.
To confirm this precisely I now tried again, changed to "_e", exported the theme, cleared the cache and revisited the loco translate WP plugin. In the plugin I selected the Pangolin-Template to edit the .pot. When I made it sync with the source files, one unused string got removed from the template. After another change back to "_x", 'Search Albums' was found and added to the .pot again as a new string.
Offline
Pages: 1