-
Notifications
You must be signed in to change notification settings - Fork 1
/
edge-case-test.html
122 lines (112 loc) · 4.37 KB
/
edge-case-test.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
<!--
@license https://github.com/t2ym/i18n-behavior/blob/master/LICENSE.md
Copyright (c) 2016, Tetsuya Mori <t2y3141592@gmail.com>. All rights reserved.
--><html lang="en" preferred="" locales-path="locales"><head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes">
<script src="../../../@webcomponents/webcomponentsjs/webcomponents-bundle.js"></script>
<!-- <script src="../../../custom-elements/src/native-shim.js"></script> -->
<script src="../../../wct-browser-legacy/browser.js"></script>
<script type="module" src="./edge-case-test-imports.js"></script>
<style>
.test-container.running-test {
display: block;
}
.test-container:not(.running-test) {
display: none;
}
</style>
</head>
<body>
<h2 id="test-name"></h2>
<advanced-binding-element hidden status="ok" value="initial value" parameter="parameter text"></advanced-binding-element>
<test-fixture class="test-container" id="empty-element-fixture">
<template>
<empty-element></empty-element>
</template>
</test-fixture>
<test-fixture class="test-container" id="bound-empty-element-fixture">
<template is="dom-template">
<empty-element lang="{{lang}}" observe-html-lang="{{observeHtmlLang}}"></empty-element>
</template>
</test-fixture>
<test-fixture class="test-container" id="no-template-element-fixture">
<template>
<no-template-element></no-template-element>
</template>
</test-fixture>
<test-fixture class="test-container" id="complex-compound-binding-element-fixture">
<template is="dom-template">
<complex-compound-binding-element lang="{{lang}}" observe-html-lang="{{observeHtmlLang}}"></complex-compound-binding-element>
</template>
</test-fixture>
<test-fixture class="test-container" id="advanced-binding-element-fixture">
<template is="dom-template">
<advanced-binding-element lang="{{lang}}" observe-html-lang="{{observeHtmlLang}}" status="{{status}}" value="{{value}}" parameter="{{parameter}}"></advanced-binding-element>
</template>
</test-fixture>
<div class="test-container">
<template id="edge-case-dom-bind" is="i18n-dom-bind" basepath="/" localizable-text="embedded"><i18n-format lang="{{effectiveLang}}"><span>{{text.text.0}}</span><span slot="1">{{text.name}}</span></i18n-format><i18n-number lang="{{effectiveLang}}">{{text.i18n-number_1}}</i18n-number>
<i18n-format lang="{{effectiveLang}}">
<json-data>{{serialize(text.format)}}</json-data>
<i18n-number offset="" slot="1" lang="{{effectiveLang}}">{{text.i18n-format_2.1}}</i18n-number>
</i18n-format>
<i18n-format lang="{{effectiveLang}}">
<span>{{text.i18n-format_3.0}}</span>
<br slot="1">
</i18n-format>
<span>{{tr('key')}}</span>
<span>{{tr('key',text.table)}}</span>
<span>{{tr('key','string')}}</span>
<input placeholder="{ invalid: json }">
<p><i18n-format lang="{{effectiveLang}}"><span>{{text.p_8.0}}</span><br slot="1"><span slot="2"></span><span slot="3"> </span></i18n-format></p>
<p><i18n-format lang="{{effectiveLang}}"><span>{{text.p_9.0}}</span><template is="dom-repeat" items="[0,1]"><br slot="1"></template></i18n-format></p>{{text.text_10}}<br><span></span> <span> </span>{{text.text_14}}<template id="localizable-text">
<json-data>
{
"meta": {},
"model": {},
"text": [
" name = {1} ",
"{{text.name}}"
],
"i18n-number_1": "1",
"i18n-format_2": [
"{{text.format}}",
"1"
],
"i18n-format_3": [
"format",
""
],
"p_8": [
"hello {1}{2} {3} world",
"<br>",
"<span>",
"<span>"
],
"p_9": [
"hello{1}world",
"<br>"
],
"text_10": " hello ",
"text_14": " world "
}
</json-data>
</template>
</template>
<template>
<json-data text-id="target" data="{}"></json-data>
<json-data id="func">{
"func": or
}</json-data>
<json-data text-id="format">{
"other": "other format"
}</json-data>
<json-data text-id="table">{
"message-id": "message 1"
}</json-data>
<span text-id="name">John</span>
</template>
</div>
<i18n-preference></i18n-preference>
</body></html>