|
1 | 1 | // Vitest Snapshot v1
|
2 | 2 |
|
3 |
| -exports[`external ftl file support > can read files from a directory 1`] = ` |
4 |
| -"'use strict'; |
5 |
| -
|
6 |
| -var bundle = require('@fluent/bundle'); |
7 |
| -var vue = require('vue'); |
8 |
| -
|
9 |
| -var en_ftl = new bundle.FluentResource(\\"# Simple things are simple.\\\\nhello-user = Hello, {$userName}!\\\\n\\\\n# Complex things are possible.\\\\nshared-photos =\\\\n {$userName} {$photoCount ->\\\\n [one] added one photo\\\\n *[other] added {$photoCount} new photos\\\\n } to {$userGender ->\\\\n [male] his stream\\\\n [female] her stream\\\\n *[other] their stream\\\\n }.\\\\n\\"); |
10 |
| -
|
11 |
| -var da_ftl = new bundle.FluentResource(\\"\\"); |
12 |
| -
|
13 |
| -function render(_ctx, _cache) { |
14 |
| - return (vue.openBlock(), vue.createElementBlock(\\"div\\", null, [ |
15 |
| - vue.createElementVNode(\\"div\\", null, vue.toDisplayString(_ctx.$t('hello-user', { userName: _ctx.userName })), 1 /* TEXT */), |
16 |
| - vue.createElementVNode(\\"div\\", null, vue.toDisplayString(_ctx.$t('shared-photos', { userName: _ctx.userName, photoCount: _ctx.photoCount, userGender: _ctx.userGender })), 1 /* TEXT */) |
17 |
| - ])) |
18 |
| -} |
19 |
| -
|
20 |
| -const script = {}; |
21 |
| -
|
22 |
| -script.fluent = { en: en_ftl, da: da_ftl }; |
23 |
| -script.render = render; |
24 |
| -script.__file = \\"__tests__/fixtures/components/external.vue\\"; |
25 |
| -
|
26 |
| -module.exports = script; |
27 |
| -" |
28 |
| -`; |
29 |
| -
|
30 | 3 | exports[`external ftl file support > works with vue 2 1`] = `
|
31 | 4 | "'use strict';
|
32 | 5 |
|
@@ -151,10 +124,69 @@ function __vue2_injectStyles (context) {
|
151 | 124 | this[o] = __cssModules[o];
|
152 | 125 | }
|
153 | 126 | }
|
| 127 | +
|
154 | 128 | __component__.options.fluent = { en: en_ftl, da: da_ftl };
|
155 | 129 | __component__.options.__file = \\"__tests__/fixtures/components/external.vue\\";
|
156 | 130 | var external = /*#__PURE__*/(function () { return __component__.exports })();
|
157 | 131 |
|
158 | 132 | module.exports = external;
|
159 | 133 | "
|
160 | 134 | `;
|
| 135 | +
|
| 136 | +exports[`external ftl file support > works with vue 3 1`] = ` |
| 137 | +"'use strict'; |
| 138 | +
|
| 139 | +var bundle = require('@fluent/bundle'); |
| 140 | +var vue = require('vue'); |
| 141 | +
|
| 142 | +var en_ftl = new bundle.FluentResource(\\"# Simple things are simple.\\\\nhello-user = Hello, {$userName}!\\\\n\\\\n# Complex things are possible.\\\\nshared-photos =\\\\n {$userName} {$photoCount ->\\\\n [one] added one photo\\\\n *[other] added {$photoCount} new photos\\\\n } to {$userGender ->\\\\n [male] his stream\\\\n [female] her stream\\\\n *[other] their stream\\\\n }.\\\\n\\"); |
| 143 | +
|
| 144 | +var da_ftl = new bundle.FluentResource(\\"\\"); |
| 145 | +
|
| 146 | +function render(_ctx, _cache) { |
| 147 | + return (vue.openBlock(), vue.createElementBlock(\\"div\\", null, [ |
| 148 | + vue.createElementVNode(\\"div\\", null, vue.toDisplayString(_ctx.$t('hello-user', { userName: _ctx.userName })), 1 /* TEXT */), |
| 149 | + vue.createElementVNode(\\"div\\", null, vue.toDisplayString(_ctx.$t('shared-photos', { userName: _ctx.userName, photoCount: _ctx.photoCount, userGender: _ctx.userGender })), 1 /* TEXT */) |
| 150 | + ])) |
| 151 | +} |
| 152 | +
|
| 153 | +const script = {}; |
| 154 | +
|
| 155 | +
|
| 156 | +script.render = render; |
| 157 | +script.fluent = { en: en_ftl, da: da_ftl }; |
| 158 | +script.__file = \\"__tests__/fixtures/components/external.vue\\"; |
| 159 | +
|
| 160 | +module.exports = script; |
| 161 | +" |
| 162 | +`; |
| 163 | +
|
| 164 | +exports[`external ftl file support > works with vue 3 script setup 1`] = ` |
| 165 | +"'use strict'; |
| 166 | +
|
| 167 | +require('@fluent/bundle'); |
| 168 | +var vue = require('vue'); |
| 169 | +
|
| 170 | +var en_ftl = null; |
| 171 | +
|
| 172 | +var da_ftl = null; |
| 173 | +
|
| 174 | +var script = { |
| 175 | + setup(__props) { |
| 176 | +
|
| 177 | +return (_ctx, _cache) => { |
| 178 | + return (vue.openBlock(), vue.createElementBlock(\\"div\\", null, [ |
| 179 | + vue.createElementVNode(\\"div\\", null, vue.toDisplayString(_ctx.$t('hello-user', { userName: _ctx.userName })), 1 /* TEXT */), |
| 180 | + vue.createElementVNode(\\"div\\", null, vue.toDisplayString(_ctx.$t('shared-photos', { userName: _ctx.userName, photoCount: _ctx.photoCount, userGender: _ctx.userGender })), 1 /* TEXT */) |
| 181 | + ])) |
| 182 | +} |
| 183 | +} |
| 184 | +
|
| 185 | +}; |
| 186 | +
|
| 187 | +script.fluent = { en: en_ftl, da: da_ftl }; |
| 188 | +script.__file = \\"__tests__/fixtures/components/external.setup.vue\\"; |
| 189 | +
|
| 190 | +module.exports = script; |
| 191 | +" |
| 192 | +`; |
0 commit comments