Hi Eduardo --

The sanitization of translations happens in the overlayElement function here:

https://github.com/bidaian/gaia/blob/78b2bc4cad3fcf83cbbbe4aeb77079cf956972cf/shared/js/l10n.js#L2018

and uses the list of allowed elements defined here:

https://github.com/bidaian/gaia/blob/78b2bc4cad3fcf83cbbbe4aeb77079cf956972cf/shared/js/l10n.js#L1527-L1548

If your goal is just to play around and experiment, you can edit this
list locally and <svg> should work, I think.  Keep in mind, however,
that some apps use shared/js/intl/l20n.js so make sure you're editing
the right file.

I'm curious, what's the use-case for putting SVG inside of a localized message?

Best,
-stas

On Mon, Jan 4, 2016 at 11:24 PM, Eduardo Trápani <[email protected]> wrote:
> Hi,
>
> I know it's a bad idea[1], but for a project in my development device I
> need to put an SVG inside a localized message.
>
> The thing is, all HTML is being stripped and I cannot find where that
> happens in the code. I thought it would be around here[2], but at that
> time no HTML is left in the value. I've been building and using
> console.log for a while now ...
>
> I do understand the code is meant NOT to let me insert arbitrary HTML
> :). In spite of that, could somebody tell me where the actual stripping
> takes place?
>
> In the index.ab.json for the application the entry is something like
> {..."entry": "hello <svg...</svg> world!"...} and all the quote
> characters are escaped). The result on the device is simply "hello world!".
>
> Thanks, Eduardo.
>
> [1] https://github.com/bidaian/gaia/blob/master/shared/js/l10n.js#L1987
> [2] https://github.com/bidaian/gaia/blob/master/shared/js/l10n.js#L1962
>
> _______________________________________________
> dev-fxos mailing list
> [email protected]
> https://lists.mozilla.org/listinfo/dev-fxos
_______________________________________________
dev-fxos mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-fxos

Reply via email to