You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+80-10Lines changed: 80 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,7 +19,7 @@ Head to our [Installation guide](https://vueform.com/docs/1.x/installation#insta
19
19
npm i git+https://github.com/vueform/vueform-builder-{YOUR_ID}.git
20
20
```
21
21
22
-
Vueform Builder will be provided to you via a private GitHub repo. If you're installing trial replace `{YOUR_ID}` with `trial`.
22
+
Vueform Builder will be provided to you via a private GitHub repo. If you're installing trial replace `{YOUR_ID}` with `trial`. If you don't have access, [read this first](https://vueform.com/builder).
23
23
24
24
#### 3. Create `builder.config.js`
25
25
@@ -4613,7 +4613,7 @@ export default {
4613
4613
'space-tags-lg':'0.1875rem',
4614
4614
'floating-top':'0rem',
4615
4615
'floating-top-sm':'0rem',
4616
-
'floating-top-lg':'0.5625rem',
4616
+
'floating-top-lg':'0.6875rem',
4617
4617
'bg-input':'#ffffff',
4618
4618
'bg-input-hover':'#ffffff',
4619
4619
'bg-input-focus':'#ffffff',
@@ -4845,7 +4845,7 @@ export default {
4845
4845
'space-tags-lg':'0.1875rem',
4846
4846
'floating-top':'0rem',
4847
4847
'floating-top-sm':'0rem',
4848
-
'floating-top-lg':'0.5625rem',
4848
+
'floating-top-lg':'0.6875rem',
4849
4849
'bg-input':'#ffffff',
4850
4850
'bg-input-focus':'#ffffff',
4851
4851
'bg-input-hover':'#ffffff',
@@ -5216,6 +5216,79 @@ export default {
5216
5216
}
5217
5217
```
5218
5218
5219
+
## Locales
5220
+
5221
+
Certain element properties can be provided in multiple locales. We can enable this feature by defining the list of available locales in `builder.config.js`:
5222
+
5223
+
```js
5224
+
// builder.config.js
5225
+
5226
+
exportdefault {
5227
+
locales: { // default `{}`
5228
+
en:'English',
5229
+
de:'German',
5230
+
// ...
5231
+
}
5232
+
}
5233
+
```
5234
+
5235
+
When locales are enabled a language selector will appear next to the config panel and the fields which can be localized will have the locale's ISO code on their right:
5236
+
5237
+

5238
+
5239
+
The following properties can be localized:
5240
+
5241
+
***Properties**
5242
+
* label
5243
+
* tooltip
5244
+
* placeholder
5245
+
* floating
5246
+
* description
5247
+
***Options**
5248
+
* text (checkbox, radio, toggle)
5249
+
* on & off label (toggle)
5250
+
* no options text & no results text (select, multiselect, tags)
5251
+
***Data**
5252
+
* data source / list / option labels (checkbox group, radio group, select, multiselect, tags)
5253
+
* default (text, textarea, editor, hidden)
5254
+
***Decorators**
5255
+
* prefix
5256
+
* suffix
5257
+
* before
5258
+
* between
5259
+
* after
5260
+
5261
+
We can set the default and fallback locale in our config (they both default to `en`):
5262
+
5263
+
```js
5264
+
// builder.config.js
5265
+
5266
+
exportdefault {
5267
+
locales: {
5268
+
en:'English',
5269
+
de:'German',
5270
+
// ...
5271
+
},
5272
+
defaultLocale:'en', // default 'en'
5273
+
fallbackLocale:'en', // default 'en'
5274
+
}
5275
+
```
5276
+
5277
+
The flags are rendered using emojies which are available on most devices without having to add extra resources. This can be disabled:
5278
+
5279
+
```js
5280
+
// builder.config.js
5281
+
5282
+
exportdefault {
5283
+
// ...
5284
+
emojiFlags:false, // default `true`
5285
+
}
5286
+
```
5287
+
5288
+
When emoji flags are disabled ISO codes will appear instead of flags. They can be further customized with CSS with `.vfb-flag-{ISO}` classes.
5289
+
5290
+
> If you've created a form with localized properties and then you disable the localization feature, make sure to convert back localized properties to plain before loading it back to the builder.
5291
+
5219
5292
## Custom Config
5220
5293
5221
5294
Custom configuration can be applied to `<VueformBuilder>` individually which will be used instead of the default `builder.config.js`:
@@ -7036,7 +7109,7 @@ import {
7036
7109
TypeField,
7037
7110
NameField,
7038
7111
MetaField,
7039
-
DefaultField,
7112
+
DefaultField_multilingual,
7040
7113
SubmitField,
7041
7114
ConditionsField,
7042
7115
IdField,
@@ -7058,7 +7131,7 @@ export default {
7058
7131
name:'data',
7059
7132
label:'Data',
7060
7133
fields: {
7061
-
default: { type:DefaultField },
7134
+
default: { type:DefaultField_multilingual },
7062
7135
submit: { type: SubmitField },
7063
7136
},
7064
7137
},
@@ -8395,7 +8468,7 @@ import {
8395
8468
InfoField,
8396
8469
PlaceholderField,
8397
8470
DescriptionField,
8398
-
DefaultField,
8471
+
DefaultField_multilingual,
8399
8472
SubmitField,
8400
8473
AddonsField,
8401
8474
BeforeField,
@@ -8432,7 +8505,7 @@ export default {
8432
8505
name:'data',
8433
8506
label:'Data',
8434
8507
fields: {
8435
-
default: { type:DefaultField },
8508
+
default: { type:DefaultField_multilingual },
8436
8509
submit: { type: SubmitField },
8437
8510
},
8438
8511
},
@@ -8901,9 +8974,6 @@ Unfortunately the polyfill isn't perfect, so we recommend using Google Chrome, E
0 commit comments