FIX: Escape $ in translations before interpolating (PR #8100)

Context: Notification character bug - ux - Discourse Meta

I was almost pulling my hairs out wondering why this would happen, then I took a closer look at the replace(pattern, replacement) function:

The replacement string can include the following special replacement patterns:

Pattern Inserts
$& Inserts the matched substring.

The dollar sign ($) is a special replace pattern, and $& inserts the matched string… :sweat_smile: Thus dollars signs need to be escaped with the special pattern $$, which inserts a single $.

Let me know what you think, thanks!


1 Like

You’ve signed the CLA, xrav3nz. Thank you! This pull request is ready for review.

This pull request has been mentioned on Discourse Meta. There might be relevant details there: