UNPKG

cldr

Version:

Library for extracting data from CLDR (the Unicode Common Locale Data Repository)

213 lines (212 loc) 5.03 kB
[ { "src": "hello", "exp": "hello" }, { "src": "hello {world}", "exp": "hello world" }, { "src": "hello { world\t\n}", "exp": "hello world", "cleanSrc": "hello {world}" }, { "src": "hello {\u3000world\r}", "exp": "hello world", "cleanSrc": "hello {world}" }, { "src": "hello {|world|}", "exp": "hello world" }, { "src": "hello {||}", "exp": "hello " }, { "src": "hello {$place}", "params": { "place": "world" }, "exp": "hello world" }, { "src": "hello {$place-.}", "params": { "place-.": "world" }, "exp": "hello world" }, { "src": "hello {$place}", "errors": [{ "type": "unresolved-var" }], "exp": "hello {$place}" }, { "src": "{$one} and {$two}", "params": { "one": 1.3, "two": 4.2 }, "exp": "1.3 and 4.2" }, { "src": "{$one} et {$two}", "locale": "fr", "params": { "one": 1.3, "two": 4.2 }, "exp": "1,3 et 4,2" }, { "src": ".local $foo = {bar} {{bar {$foo}}}", "exp": "bar bar" }, { "src": ".local $foo = {|bar|} {{bar {$foo}}}", "exp": "bar bar" }, { "src": ".local $foo = {|bar|} {{bar {$foo}}}", "params": { "foo": "foo" }, "exp": "bar bar" }, { "src": ".local $foo = {$bar} {{bar {$foo}}}", "params": { "bar": "foo" }, "exp": "bar foo" }, { "src": ".local $foo = {$baz} .local $bar = {$foo} {{bar {$bar}}}", "params": { "baz": "foo" }, "exp": "bar foo" }, { "src": ".input {$foo} {{bar {$foo}}}", "params": { "foo": "foo" }, "exp": "bar foo" }, { "src": ".input {$foo} .local $bar = {$foo} {{bar {$bar}}}", "params": { "foo": "foo" }, "exp": "bar foo" }, { "src": ".local $foo = {$baz} .local $bar = {$foo} {{bar {$bar}}}", "params": { "baz": "foo" }, "exp": "bar foo" }, { "src": ".local $x = {42} .local $y = {$x} {{{$x} {$y}}}", "exp": "42 42" }, { "src": "{#tag}", "exp": "", "parts": [{ "type": "markup", "kind": "open", "name": "tag" }] }, { "src": "{#tag}content", "exp": "content", "parts": [ { "type": "markup", "kind": "open", "name": "tag" }, { "type": "literal", "value": "content" } ] }, { "src": "{#ns:tag}content{/ns:tag}", "exp": "content", "parts": [ { "type": "markup", "kind": "open", "name": "ns:tag" }, { "type": "literal", "value": "content" }, { "type": "markup", "kind": "close", "name": "ns:tag" } ] }, { "src": "{/tag}content", "exp": "content", "parts": [ { "type": "markup", "kind": "close", "name": "tag" }, { "type": "literal", "value": "content" } ] }, { "src": "{#tag foo=bar}", "exp": "", "parts": [ { "type": "markup", "kind": "open", "name": "tag", "options": { "foo": "bar" } } ] }, { "src": "{#tag foo=bar/}", "cleanSrc": "{#tag foo=bar /}", "exp": "", "parts": [ { "type": "markup", "kind": "standalone", "name": "tag", "options": { "foo": "bar" } } ] }, { "src": "{#tag a:foo=|foo| b:bar=$bar}", "params": { "bar": "b a r" }, "exp": "", "parts": [ { "type": "markup", "kind": "open", "name": "tag", "options": { "a:foo": "foo", "b:bar": "b a r" } } ] }, { "src": "{/tag foo=bar}", "exp": "", "parts": [ { "type": "markup", "kind": "close", "name": "tag", "options": { "foo": "bar" } } ] }, { "src": "{42 @foo @bar=13}", "exp": "42", "parts": [{ "type": "string", "value": "42" }] }, { "src": "{42 @foo=$bar}", "exp": "42", "parts": [{ "type": "string", "value": "42" }] }, { "src": "foo {+reserved}", "exp": "foo {+}", "parts": [ { "type": "literal", "value": "foo " }, { "type": "fallback", "source": "+" } ], "errors": [{ "type": "unsupported-annotation" }] }, { "src": "foo {&private}", "exp": "foo {&}", "parts": [ { "type": "literal", "value": "foo " }, { "type": "fallback", "source": "&" } ], "errors": [{ "type": "unsupported-annotation" }] }, { "src": "foo {?reserved @a @b=$c}", "exp": "foo {?}", "parts": [ { "type": "literal", "value": "foo " }, { "type": "fallback", "source": "?" } ], "errors": [{ "type": "unsupported-annotation" }] }, { "src": ".foo {42} {{bar}}", "exp": "bar", "parts": [{ "type": "literal", "value": "bar" }], "errors": [{ "type": "unsupported-statement" }] }, { "src": ".foo{42}{{bar}}", "cleanSrc": ".foo {42} {{bar}}", "exp": "bar", "parts": [{ "type": "literal", "value": "bar" }], "errors": [{ "type": "unsupported-statement" }] }, { "src": ".foo |}lit{| {42}{{bar}}", "cleanSrc": ".foo |}lit{| {42} {{bar}}", "exp": "bar", "parts": [{ "type": "literal", "value": "bar" }], "errors": [{ "type": "unsupported-statement" }] } ]