Forums Forums Search & Filter Pro using string to translate text in within filter

Viewing 10 posts - 1 through 10 (of 26 total)
  • Anonymous
    #214151

    Hello I have your filter setup but our client is after the filter to be available in different languages. I have created a single-downloads template and a single-downloads_french template and made the appropriate changes, however I am looking for a string to replace the text within the dropdowns and text next to the selector boxes.

    Is this possible and you have any guidelines to follow to implement this?

    Thanks Phil

    Trevor
    #214189

    Are you using a language plugin (like WPML or Polylang)? If so, they should be translating the front end terms in the form. In the backend, our plugin is not yet multi-language/translation ready.

    Anonymous
    #214211

    Hello, No I am not using any translation plugin. I am wanting to translate manually as so the translation is as accurate as possible. I was hoping to add a custom string to either the post type or the function.php so it will replace a specific word within the filter to the translated version.

    Thanks

    Trevor
    #214215

    Frontend or backend? If it is frontend, that will get complicated. Backend, I am not sure it is possible. Front option terms can be manually changed using a filter (https://searchandfilter.com/documentation/action-filter-reference/#filter-input-object). But some other form elements cannot (like the headings) – you may need to use JavaScript to do this, and might not be ideal..

    Anonymous
    #214227

    Hello Sorry I was talking about frontend, as reference you can take a look at this link. I only need to translate the filter options now.
    https://extensions.brookstonesites.co.uk/downloads_french

    Trevor
    #214234

    As I said, your only option may be to use that filter I referenced.

    Anonymous
    #214393

    Hello can you help understand the Filter Input Object. Where do I place this and how do I use it to replace the text for example the selection ‘Brochures’

    Anonymous
    #214427

    I am trying this code from the documentation you supplied. However it just removes all the options.
    How can I use this correctly?

    <?php
    function filter_input_object($input_object, $sfid)
    {
    foreach($input_object['options'] as $option)
    	{
    		if($option->value=="brochures")
    		{//the option with no value is always the "all items" or unselected state
    			$option->label = "Brochures";
    		}
    		else if($option->value=="brochures")
    		{//we want to change the label for the option "black" - we can feed back in the count number to the label for this field type
    			$option->label = "test (".$option->count.")";
    	}
    	}
    }
    add_filter('sf_input_object_pre', 'filter_input_object', 10, 2);
    ?>
    Trevor
    #214449

    I think you need to take a look at some of the snippets shown in this search:

    https://support.searchandfilter.com/forums/search/sf_input_object_pre+label+option/

    Anonymous
    #214451

    Hello from there snippets what is co authors plus? what would I replace this with in my case.

    Thanks

Viewing 10 posts - 1 through 10 (of 26 total)