Skip to content

Commit 68ece4d

Browse files
committed
1.0.16
1 parent 2340ea5 commit 68ece4d

File tree

2 files changed

+92
-10
lines changed

2 files changed

+92
-10
lines changed

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
## v1.0.16
2+
3+
> `2023-03-14`
4+
5+
### 🎉 Feature
6+
- Localization feature added. Certain form properties now can be provided in multiple locales.
7+
- Added `locales`, `defaultLocale`, `fallbackLocale` and `emojiFlags` options to config.
8+
9+
### 🐞 Bug Fixes
10+
- Don't submit page on Search elements enter.
11+
- Custom attributes frozen when single space was entered as key or value.
12+
113
## v1.0.15
214

315
> `2023-03-02`

README.md

Lines changed: 80 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Head to our [Installation guide](https://vueform.com/docs/1.x/installation#insta
1919
npm i git+https://github.com/vueform/vueform-builder-{YOUR_ID}.git
2020
```
2121

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).
2323

2424
#### 3. Create `builder.config.js`
2525

@@ -4613,7 +4613,7 @@ export default {
46134613
'space-tags-lg': '0.1875rem',
46144614
'floating-top': '0rem',
46154615
'floating-top-sm': '0rem',
4616-
'floating-top-lg': '0.5625rem',
4616+
'floating-top-lg': '0.6875rem',
46174617
'bg-input': '#ffffff',
46184618
'bg-input-hover': '#ffffff',
46194619
'bg-input-focus': '#ffffff',
@@ -4845,7 +4845,7 @@ export default {
48454845
'space-tags-lg': '0.1875rem',
48464846
'floating-top': '0rem',
48474847
'floating-top-sm': '0rem',
4848-
'floating-top-lg': '0.5625rem',
4848+
'floating-top-lg': '0.6875rem',
48494849
'bg-input': '#ffffff',
48504850
'bg-input-focus': '#ffffff',
48514851
'bg-input-hover': '#ffffff',
@@ -5216,6 +5216,79 @@ export default {
52165216
}
52175217
```
52185218

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+
export default {
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+
![Locales](./assets/screenshot-locales.png)
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+
export default {
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+
export default {
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+
52195292
## Custom Config
52205293

52215294
Custom configuration can be applied to `<VueformBuilder>` individually which will be used instead of the default `builder.config.js`:
@@ -7036,7 +7109,7 @@ import {
70367109
TypeField,
70377110
NameField,
70387111
MetaField,
7039-
DefaultField,
7112+
DefaultField_multilingual,
70407113
SubmitField,
70417114
ConditionsField,
70427115
IdField,
@@ -7058,7 +7131,7 @@ export default {
70587131
name: 'data',
70597132
label: 'Data',
70607133
fields: {
7061-
default: { type: DefaultField },
7134+
default: { type: DefaultField_multilingual },
70627135
submit: { type: SubmitField },
70637136
},
70647137
},
@@ -8395,7 +8468,7 @@ import {
83958468
InfoField,
83968469
PlaceholderField,
83978470
DescriptionField,
8398-
DefaultField,
8471+
DefaultField_multilingual,
83998472
SubmitField,
84008473
AddonsField,
84018474
BeforeField,
@@ -8432,7 +8505,7 @@ export default {
84328505
name: 'data',
84338506
label: 'Data',
84348507
fields: {
8435-
default: { type: DefaultField },
8508+
default: { type: DefaultField_multilingual },
84368509
submit: { type: SubmitField },
84378510
},
84388511
},
@@ -8901,9 +8974,6 @@ Unfortunately the polyfill isn't perfect, so we recommend using Google Chrome, E
89018974

89028975
# Upcoming Features
89038976

8904-
- translatable properties (eg. label, description)
8905-
- "or" condition & condition groups
8906-
- mobile / desktop view
89078977
- hooks & events
89088978
- restrict container children types
89098979

0 commit comments

Comments
 (0)