File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -114,3 +114,23 @@ tears-of-joy1 = {"\U01F602"}
114114# character used here is.
115115tears-of-joy2 = 😂
116116```
117+
118+ ----
119+ #### Note for Developers
120+
121+ If you're writing Fluent inside another programming language that uses
122+ backslash for escaping, you'll need to use _ two_ backslashes to start an escape
123+ sequence in Fluent's quoted text. The first backslash is parsed by the host
124+ programming language and makes the second backslash a normal character _ in that
125+ language_ . The second backslash can then be correctly parsed by Fluent.
126+
127+ In JavaScript, for instance, the ` privacy-label ` message from one of the
128+ previous examples could be added programmatically to a bundle by using two
129+ backslashes in the source code:
130+
131+ ```
132+ let bundle = new FluentBundle("en");
133+ bundle.addMessages(`
134+ privacy-label = Privacy{"\\u00A0"}Policy
135+ `);
136+ ```
You can’t perform that action at this time.
0 commit comments