• Resolved W?odz Mur

    (@iwpresss)


    Hello! Help understand. FiboSearch plugin – Ajax Search for WooCommerce does not see the language file, for example: ajax-search-for-woocommerce-uk.mo.

    What I see on the site

    Plugin code

    
    'search_placeholder' => DGWT_WCAS()->settings->getOption( 'search_placeholder', __( 'Search for products...', 'ajax-search-for-woocommerce' ) ),
    
    600  => array(
                'name'    => 'search_placeholder',
                'label'   => __( 'Search input placeholder', 'ajax-search-for-woocommerce' ),
                'type'    => 'text',
                'default' => __( 'Search for products...', 'ajax-search-for-woocommerce' ),
            ),

    File ajax-search-for-woocommerce-uk.po

    
    #: includes/Helpers.php:1030 includes/Settings.php:213
    msgid "Search for products..."
    msgstr "Пошук товар?в..."
    

    I put the language file in the wp-content/languages/plugin folder.
    I tried to put it in the wp-content/plugins/ajax-search-for-woocommerce/languages folder, but the translation is missing. See screenshots.

    Where did I go wrong?

    • This topic was modified 2 years, 5 months ago by W?odz Mur.
    • This topic was modified 2 years, 5 months ago by W?odz Mur.
    • This topic was modified 2 years, 5 months ago by W?odz Mur.
    • This topic was modified 2 years, 5 months ago by W?odz Mur.
    • This topic was modified 2 years, 5 months ago by W?odz Mur.

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Kris

    (@c0nst)

    Hi @iwpresss

    There is no need to add this file. We have a filter that allows you to translate FiboSearch labels.

    Below placeholders can be changed in WooCommerce -> FiboSearch -> under the Search bar and Autocomplete tab.

    – Placeholder
    – Submit text
    – More results
    – No-results

    And this labels can be changed by filters, see example:

    add_filter( 'dgwt/wcas/labels', function ( $labels ) {
        $labels['search_placeholder'] = 'Пошук товар?в...'; // Change label "Search for products…
    " to "Пошук товар?в..."
        return $labels;
    } );

    You have to paste the following code samples into functions.php in your child theme or use the Code Snippets plugin.

    To learn more about FiboSearch labels read this article: https://fibosearch.com/documentation/tips-tricks/how-to-change-labels/

    Regards,
    Kris`

    Thread Starter W?odz Mur

    (@iwpresss)

    Hi Kris (@c0nst),

    Thank you very much for your answer.
    I will do it all.
    But I do not understand why the well-known translation mechanism does not work. Or will the rest of the texts be translated?
    Everything except FiboSearch labels?

    Best regards,
    Wlodz Mur

    Thread Starter W?odz Mur

    (@iwpresss)

    Added 19 pcs.:add_filter( 'dgwt/wcas/labels', function ( $labels )
    Everything works very well, thank you for your help.
    But I’m still surprised ??

    I don’t use the Code Snippets plugin yet.

    Thanks again. I understood everything and applied your help.

    Best regards, Wlodz Mur

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘The plugin does not see the language file (.po/.mo)’ is closed to new replies.