There are at least two solutions for this problem:
* use JSMessages (my recommendation is to use this approach, but more code needs to be rewritten)- example from MarketingToolbox: 
https://github.com/Wikia/app/blob/dev/extensions/wikia/SpecialMarketingToolbox/SpecialMarketingToolbox.setup.php#L49 and https://github.com/Wikia/app/blob/dev/extensions/wikia/SpecialMarketingToolbox/js/MarketingToolbox.js#L18
* escape string in php and unescape in js

Also getting modal from controller can be tricky when error is occurred on controller.