• Resolved j11k00

    (@j11k00)


    Hi!

    First of all, thank you for developing this wonderful plugin.

    I’m trying to create a translation for the plugin, but it seems that some strings used in the facet panel headings (e.g., category, tags) are not translatable. Is there any other way to translate these without hard-coding them with a overide in a child theme?

    Thanks in advance

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author CodeManas

    (@codemanas)

    Hi @j11k00

    If you are referring to the actual Category / Tags text – then this is what the facet header

    https://www.awesomescreenshot.com/image/50190405?key=4b42e46f8847e95f195c03fffb94256f

    Then the text for this is the same that is used as the facet label.
    So this is actually dynamic – this is not available to translate via a pot file.

    Thread Starter j11k00

    (@j11k00)

    Thanks for looking into this, and apologies for my late reply. Yes, the category label in your screenshot is what I’m referring to. Is there any way it could be translated without hardcoding it in an overriding child theme file?

    Thanks in advance.

    Plugin Contributor digamberpradhan

    (@digamberpradhan)

    Hi Again,

    Coding will be required to change these labels.
    You can add this snippet to either your child theme or a custom plugin.

    function cm_swt_2024_08_28_change_filter_label( $label, $post_type ) {
    if ( strtolower($label) == 'category') {
    //category in French
    $label = 'catégorie';
    }

    return $label;
    }

    add_filter( 'cm_typesense_search_facet_title', 'cm_swt_2024_08_28_change_filter_label', 10, 2 );


    I hope this helps.

    Thread Starter j11k00

    (@j11k00)

    This works! Thanks for the solution.

    All the best

    Plugin Contributor digamberpradhan

    (@digamberpradhan)

    Glad that worked.
    Cheers.

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.