I've run into a problem with internationalization and need to know the best way to move forward. we use java ResourceBundle with .properties files to internationalize the content on our software. There are areas where a dynamic value gets passed to a JavaScript alert, for example
#.properties file with ca_ES locale
warningText=regles d’apostrofació
#JavaScript with the property as parameter
<script>
alert('warningText');
</script>
So the apostrophe in the value for warningText escapes the string and causes a fatal error. We can't really use double quotes instead because of our coding standards, and it would be a ton of work to go through and change all of the code to double quotes, and we can't use something like "
because html tags don't resolve inside a javascript alert.
Lastly if within the string in the properties file we did something like this:
warningText=regles d\’apostrofació
the escape is applied during compilation or in the JVM or somewhere prior to the javascript and we end up just escaping the string anyways