Hi, i use a plugin for filter products at woo.
I would like to change the "euro" with "€"
Is this possible to do it with gettext function?

I don't want to make changes at the core of plugin.
Thanks

    Seems unlikely unless every instance of "euro" was marked for translation.

      <script>
          function cheap_euro_hack() {
      
                 document.body.innerHTML = document.body.innerHTML.replace(/euro/g, "\u20AC");
          }
          setTimeout(cheap_euro_hack, 1500);
      </script>

      ?

      chaosm sorry i dont get this 😃

      The /euro/g regular expression would also match the 'euro' letter sequence within other words (such as "european" or "teuroteu". Also, you might want to make it case-insensitive.

      /\beuro\b/gi

        chaosm

        Dalecosp's code is Javascript. You should be able to put that anywhere in your HTML output. When the browser loads that code, it'll wait 1.5 seconds and then replace every occurrence of 'euro' in the document with the symbol.

          I told you it was a cheap hack, NogDog 😛 I really don't even know how 'euro' appears on his pages, so I'm not sure how to match it. It probably should at least match the plural as well, which would be '/euro(s?)/g', and your case-sensitivity point is well-taken, so make it '/euro(s?)/gi' I'll leave it to the OP to download Edmund Weitz' The Regex Coach or visit regex101.com.

          I probably should've explained that it was JavaScript ... it's kind of obvious from looking at it to those of us who know such things, it should be obvious to most anyone who's building a web page these days, and it was partly a joke.

          I think maybe I told a story about a designer who put a page up with inline CSS and every block-level element (and some SPANs as well, which were also highly over-used) had "font-family:times" in it, on a site where the CSS sheets were all sans-serif fonts. We went round & round about its appropriateness in the office in full hearing of the VP IT and pretty much everyone else too.

          Beyond that, let's just say that I'm pretty good with cheap hacks like this one, and I know how to have PHP only serve it to people outside our offices ... #what_she_dont_know_wont_hurt, right?

            This question is a follow-on from chaosm in which the OP has a widget that displays/converts currencies but for some reason can't get it to use the appropriate symbols for those currencies on display.

            Write a Reply...