Support » Plugin: Stars Rating » hook for replace plugin text

  • Resolved philstudio

    (@philstudio)


    Hello, Fahid.
    Thank you for your plugin.
    I want to replace the words: “based on ___ reviews” with other words.
    I tried to do it like this:

    function replace_text($text) {
    	$text = str_replace(' based on ', ' first text ', $text);
    	$text = str_replace(' reviews', ' secnd text', $text);
    	return $text;
    }
    add_filter('the_content', 'replace_text');

    But this does not work with plugin text.
    But this works with the post text.
    Please help me find a hook with which you can solve this problem.
    Thank you.

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

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

    (@fahidjavid)

    Hi,

    This plugin is translation ready so you may translate it to any words via PO and MO file method.

    If you don’t want to use that method then you can use this plugin to modify any string on your site: https://wordpress.org/plugins/real-time-find-and-replace/

    Regards,

    Fahid

    Thread Starter philstudio

    (@philstudio)

    Thank you for your answer @fahidjavid

    Only 18 variables in your plugin are available for translation.

    Allow Stars Rating for comments on this page.
    Average Rating Above Comments Section
    Check the post types on which you want to enable stars rating feature.
    Donate “Stars Rating” And Similar OpenSource Projects!
    Enabled Post Types
    Error: You did not add a rating. Hit the Back button on your Web browser and resubmit your comment with a rating.
    For example: Product, Service, Brand, Event
    Hide
    No
    Regular
    Require Rating Selection
    Show
    Solid
    Stars Rating
    Stars Rating In Google Search Results
    Stars Style
    Type of Reviews In Google Search Results
    Yes

    But there are no variables: “based on” and “reviews”

    Plugin Author Fahid Javid

    (@fahidjavid)

    Hi there,

    I just pushed an update to this plugin version 3.4.0

    Please update to your plugin and you will have those missing strings to translate!
    Let me know if you face any issues in this regard.

    BTW, looking forward to your good review for this plugin 🙂

    Best wishes,

    Fahid

    Thread Starter philstudio

    (@philstudio)

    Hi, @fahidjavid
    Thank you for your work.
    I updated the plugin and tried to translate it using Loco translate https://wordpress.org/plugins/loco-translate/.
    But the same 18 variables are available for translation and there are no needed variables “based on” and “reviews”.
    Check it.
    https://sun9-58.userapi.com/59F9UA54noN4o4ddahsKSvs85wIEbuONd9jLBg/rlPEJs1EjrY.jpg
    Thank you again.

    Thread Starter philstudio

    (@philstudio)

    I’m sorry, @fahidjavid.
    All ok.
    I added variables to the template and it works.
    Thank you so much.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘hook for replace plugin text’ is closed to new replies.