Join

Replace Text That Loco Translate Can’t Reach

Don't want to mess with code snippets? Request for this to be a feature of MyListing Pro.

Instructions

  1. Create a new JS code snippet.
  2. Copy the contents of code snippet below.
  3. Paste the contents into your code snippet.
  4. Review any notes that I’ve provided.
  5. Save and enable the code snippet.
  6. Test.

Snippet

There are external elements like Mapbox, Google Maps, etc., that plugins like Loco Translate cannot reach, and in those instances, this snippet can be used. Adjust Line 5 as desired.

jQuery(document).ready(function ($) {
  $(".item-property").each(function () {
    var text = $(this).text();
    $(this).text(
      text.replace("enter-the-original-text", "enter-your-new-text")
    );
  });
});