Translating vael-ui
Every built-in string, such as the dialog close button, toast dismiss and empty states, has an English default. To translate them, pass your own i18n instance to ConfigProvider. It reads from your existing catalog under the uiKit namespace, so there’s nothing extra to install. Keys you haven’t translated show the English default. If you translate some keys but not all, development builds log one warning per locale that lists the missing ones.
import { useI18n } from 'vue-i18n'
import { ConfigProvider } from 'vael-ui'
const i18n = useI18n()<ConfigProvider :i18n="i18n">
<YourApp />
</ConfigProvider>Copy this into your locale files under the uiKit key, then translate the values:
{
"uiKit": {
"button": {
"hold": "Press and hold to confirm"
},
"dialog": {
"close": "Close",
"maximize": "Maximize",
"restore": "Restore"
},
"toast": {
"dismiss": "Dismiss"
},
"message": {
"dismiss": "Dismiss"
},
"pullToRefresh": {
"pull": "Pull to refresh",
"release": "Release to refresh",
"refreshing": "Refreshing…",
"updated": "Updated"
},
"input": {
"clear": "Clear",
"loading": "Loading…"
},
"inputNumber": {
"increment": "Increase",
"decrement": "Decrease"
},
"passwordInput": {
"show": "Show password",
"hide": "Hide password",
"met": "met",
"unmet": "not met"
},
"select": {
"empty": "No options",
"clear": "Clear selection",
"selectedCount": "{count} selected",
"loading": "Loading…"
},
"combobox": {
"empty": "No results",
"clear": "Clear selection",
"toggle": "Toggle options",
"create": "Create \"{query}\""
},
"fileUpload": {
"browse": "Browse files",
"drop": "Drop files here",
"remove": "Remove",
"rejectedAccept": "{name} wasn’t added: that type of file isn’t accepted.",
"rejectedMaxSize": "{name} wasn’t added: it’s too large.",
"rejectedMaxFiles": "{name} wasn’t added: there are already as many files as allowed."
},
"cascadeSelect": {
"empty": "No options",
"clear": "Clear selection",
"selectedCount": "{count} selected"
},
"treeSelect": {
"clear": "Clear selection",
"selectedCount": "{count} selected"
},
"speedDial": {
"label": "Actions"
},
"toolbar": {
"more": "More"
},
"stepper": {
"completed": "Completed"
},
"bottomSheet": {
"resize": "Resize sheet"
},
"resizable": {
"label": "Resize",
"start": "Resize start",
"end": "Resize end"
},
"chip": {
"remove": "Remove"
},
"splitButton": {
"more": "More actions"
},
"breadcrumb": {
"label": "Breadcrumb"
},
"commandPalette": {
"placeholder": "Search…",
"empty": "No results",
"label": "Command palette",
"results": "{count} results",
"loading": "Loading…"
},
"colorPicker": {
"saturationAndBrightness": "Saturation and brightness",
"saturation": "saturation",
"brightness": "brightness",
"hue": "Hue",
"hex": "Hex color",
"pickFromScreen": "Pick a color from the screen"
},
"tour": {
"next": "Next",
"back": "Back",
"skip": "Skip",
"done": "Done",
"stepOf": "Step {current} of {total}"
},
"toaster": {
"label": "Notifications"
},
"pagination": {
"label": "Pagination",
"first": "First page",
"previous": "Previous page",
"page": "Page {page}",
"next": "Next page",
"last": "Last page",
"pageSize": "Rows per page"
},
"datePicker": {
"chooseDate": "Choose date",
"today": "Today",
"clear": "Clear",
"hour": "Hour",
"minute": "Minute",
"increaseHour": "Increase hour",
"decreaseHour": "Decrease hour",
"increaseMinute": "Increase minute",
"decreaseMinute": "Decrease minute"
},
"dataTable": {
"selectAll": "Select all rows",
"selectRow": "Select row",
"collapseRow": "Collapse row",
"expandRow": "Expand row",
"loading": "Loading…",
"columnWidth": "{label}: {width} pixels",
"sortedAscending": "Sorted by {label}, ascending",
"sortedDescending": "Sorted by {label}, descending",
"sortCleared": "Sort cleared"
},
"sortable": {
"instructions": "Press Space or Enter to start reordering. Use the arrow keys to move, Space to drop, Escape to cancel.",
"grabbed": "Grabbed {label}. Position {position} of {total}.",
"moved": "{label} moved to position {position} of {total}.",
"movedToLevel": "{label} moved to position {position} of {total}, level {depth}.",
"dropped": "Dropped {label} at position {position} of {total}.",
"cancelled": "Reordering cancelled. {label} returned to its original position."
},
"rating": {
"valueText": "{value} of {max}"
},
"slider": {
"minimum": "Minimum",
"maximum": "Maximum"
},
"calendar": {
"weekNumber": "Week {week}",
"previousMonth": "Previous month",
"nextMonth": "Next month",
"previousYear": "Previous year",
"nextYear": "Next year",
"previousYears": "Previous years",
"nextYears": "Next years"
}
}
}| Key | English default |
|---|---|
uiKit.button.hold | Press and hold to confirm |
uiKit.dialog.close | Close |
uiKit.dialog.maximize | Maximize |
uiKit.dialog.restore | Restore |
uiKit.toast.dismiss | Dismiss |
uiKit.message.dismiss | Dismiss |
uiKit.pullToRefresh.pull | Pull to refresh |
uiKit.pullToRefresh.release | Release to refresh |
uiKit.pullToRefresh.refreshing | Refreshing… |
uiKit.pullToRefresh.updated | Updated |
uiKit.input.clear | Clear |
uiKit.input.loading | Loading… |
uiKit.inputNumber.increment | Increase |
uiKit.inputNumber.decrement | Decrease |
uiKit.passwordInput.show | Show password |
uiKit.passwordInput.hide | Hide password |
uiKit.passwordInput.met | met |
uiKit.passwordInput.unmet | not met |
uiKit.select.empty | No options |
uiKit.select.clear | Clear selection |
uiKit.select.selectedCount | {count} selected |
uiKit.select.loading | Loading… |
uiKit.combobox.empty | No results |
uiKit.combobox.clear | Clear selection |
uiKit.combobox.toggle | Toggle options |
uiKit.combobox.create | Create "{query}" |
uiKit.fileUpload.browse | Browse files |
uiKit.fileUpload.drop | Drop files here |
uiKit.fileUpload.remove | Remove |
uiKit.fileUpload.rejectedAccept | {name} wasn’t added: that type of file isn’t accepted. |
uiKit.fileUpload.rejectedMaxSize | {name} wasn’t added: it’s too large. |
uiKit.fileUpload.rejectedMaxFiles | {name} wasn’t added: there are already as many files as allowed. |
uiKit.cascadeSelect.empty | No options |
uiKit.cascadeSelect.clear | Clear selection |
uiKit.cascadeSelect.selectedCount | {count} selected |
uiKit.treeSelect.clear | Clear selection |
uiKit.treeSelect.selectedCount | {count} selected |
uiKit.speedDial.label | Actions |
uiKit.toolbar.more | More |
uiKit.stepper.completed | Completed |
uiKit.bottomSheet.resize | Resize sheet |
uiKit.resizable.label | Resize |
uiKit.resizable.start | Resize start |
uiKit.resizable.end | Resize end |
uiKit.chip.remove | Remove |
uiKit.splitButton.more | More actions |
uiKit.breadcrumb.label | Breadcrumb |
uiKit.commandPalette.placeholder | Search… |
uiKit.commandPalette.empty | No results |
uiKit.commandPalette.label | Command palette |
uiKit.commandPalette.results | {count} results |
uiKit.commandPalette.loading | Loading… |
uiKit.colorPicker.saturationAndBrightness | Saturation and brightness |
uiKit.colorPicker.saturation | saturation |
uiKit.colorPicker.brightness | brightness |
uiKit.colorPicker.hue | Hue |
uiKit.colorPicker.hex | Hex color |
uiKit.colorPicker.pickFromScreen | Pick a color from the screen |
uiKit.tour.next | Next |
uiKit.tour.back | Back |
uiKit.tour.skip | Skip |
uiKit.tour.done | Done |
uiKit.tour.stepOf | Step {current} of {total} |
uiKit.toaster.label | Notifications |
uiKit.pagination.label | Pagination |
uiKit.pagination.first | First page |
uiKit.pagination.previous | Previous page |
uiKit.pagination.page | Page {page} |
uiKit.pagination.next | Next page |
uiKit.pagination.last | Last page |
uiKit.pagination.pageSize | Rows per page |
uiKit.datePicker.chooseDate | Choose date |
uiKit.datePicker.today | Today |
uiKit.datePicker.clear | Clear |
uiKit.datePicker.hour | Hour |
uiKit.datePicker.minute | Minute |
uiKit.datePicker.increaseHour | Increase hour |
uiKit.datePicker.decreaseHour | Decrease hour |
uiKit.datePicker.increaseMinute | Increase minute |
uiKit.datePicker.decreaseMinute | Decrease minute |
uiKit.dataTable.selectAll | Select all rows |
uiKit.dataTable.selectRow | Select row |
uiKit.dataTable.collapseRow | Collapse row |
uiKit.dataTable.expandRow | Expand row |
uiKit.dataTable.loading | Loading… |
uiKit.dataTable.columnWidth | {label}: {width} pixels |
uiKit.dataTable.sortedAscending | Sorted by {label}, ascending |
uiKit.dataTable.sortedDescending | Sorted by {label}, descending |
uiKit.dataTable.sortCleared | Sort cleared |
uiKit.sortable.instructions | Press Space or Enter to start reordering. Use the arrow keys to move, Space to drop, Escape to cancel. |
uiKit.sortable.grabbed | Grabbed {label}. Position {position} of {total}. |
uiKit.sortable.moved | {label} moved to position {position} of {total}. |
uiKit.sortable.movedToLevel | {label} moved to position {position} of {total}, level {depth}. |
uiKit.sortable.dropped | Dropped {label} at position {position} of {total}. |
uiKit.sortable.cancelled | Reordering cancelled. {label} returned to its original position. |
uiKit.rating.valueText | {value} of {max} |
uiKit.slider.minimum | Minimum |
uiKit.slider.maximum | Maximum |
uiKit.calendar.weekNumber | Week {week} |
uiKit.calendar.previousMonth | Previous month |
uiKit.calendar.nextMonth | Next month |
uiKit.calendar.previousYear | Previous year |
uiKit.calendar.nextYear | Next year |
uiKit.calendar.previousYears | Previous years |
uiKit.calendar.nextYears | Next years |