projectfluent / fluent

Fluent — planning, spec and documentation
https://projectfluent.org
Apache License 2.0
1.37k stars 43 forks source link

String with special characters #370

Open Piras314 opened 2 weeks ago

Piras314 commented 2 weeks ago

Is it possible to create a (preferrably multiline) string ignoring [] {} * etc without having to backslash or {""} every single instance of a special character? I have hundreds/thousands of lines of text riddled with special characters that I need to put into a fluent file.

alerque commented 2 weeks ago

If your messages are stuffed full of special characters and you are not using placables or other features anyway it might be easier to make the whole string a quoted literal and only have to worry about escaping double quotes.

That being said it is hard to be sure from the small amount of context, but it really sounds like you're doing something wrong architecturally to end up in this position in the first place. Are these individual messages or document size blobs? Have you considered using a templating system to to either handle translated content (there are templating languages that can embed Fluent features) or pre-processing the content from a more editable format into fluent so the translator has a more domain specific set of formatting to work with? There might be other better solutions too if we understood better what your actual use case was.