vael-ui v0.5.7

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"
    }
  }
}
KeyEnglish default
uiKit.button.holdPress and hold to confirm
uiKit.dialog.closeClose
uiKit.dialog.maximizeMaximize
uiKit.dialog.restoreRestore
uiKit.toast.dismissDismiss
uiKit.message.dismissDismiss
uiKit.pullToRefresh.pullPull to refresh
uiKit.pullToRefresh.releaseRelease to refresh
uiKit.pullToRefresh.refreshingRefreshing…
uiKit.pullToRefresh.updatedUpdated
uiKit.input.clearClear
uiKit.input.loadingLoading…
uiKit.inputNumber.incrementIncrease
uiKit.inputNumber.decrementDecrease
uiKit.passwordInput.showShow password
uiKit.passwordInput.hideHide password
uiKit.passwordInput.metmet
uiKit.passwordInput.unmetnot met
uiKit.select.emptyNo options
uiKit.select.clearClear selection
uiKit.select.selectedCount{count} selected
uiKit.select.loadingLoading…
uiKit.combobox.emptyNo results
uiKit.combobox.clearClear selection
uiKit.combobox.toggleToggle options
uiKit.combobox.createCreate "{query}"
uiKit.fileUpload.browseBrowse files
uiKit.fileUpload.dropDrop files here
uiKit.fileUpload.removeRemove
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.emptyNo options
uiKit.cascadeSelect.clearClear selection
uiKit.cascadeSelect.selectedCount{count} selected
uiKit.treeSelect.clearClear selection
uiKit.treeSelect.selectedCount{count} selected
uiKit.speedDial.labelActions
uiKit.toolbar.moreMore
uiKit.stepper.completedCompleted
uiKit.bottomSheet.resizeResize sheet
uiKit.resizable.labelResize
uiKit.resizable.startResize start
uiKit.resizable.endResize end
uiKit.chip.removeRemove
uiKit.splitButton.moreMore actions
uiKit.breadcrumb.labelBreadcrumb
uiKit.commandPalette.placeholderSearch…
uiKit.commandPalette.emptyNo results
uiKit.commandPalette.labelCommand palette
uiKit.commandPalette.results{count} results
uiKit.commandPalette.loadingLoading…
uiKit.colorPicker.saturationAndBrightnessSaturation and brightness
uiKit.colorPicker.saturationsaturation
uiKit.colorPicker.brightnessbrightness
uiKit.colorPicker.hueHue
uiKit.colorPicker.hexHex color
uiKit.colorPicker.pickFromScreenPick a color from the screen
uiKit.tour.nextNext
uiKit.tour.backBack
uiKit.tour.skipSkip
uiKit.tour.doneDone
uiKit.tour.stepOfStep {current} of {total}
uiKit.toaster.labelNotifications
uiKit.pagination.labelPagination
uiKit.pagination.firstFirst page
uiKit.pagination.previousPrevious page
uiKit.pagination.pagePage {page}
uiKit.pagination.nextNext page
uiKit.pagination.lastLast page
uiKit.pagination.pageSizeRows per page
uiKit.datePicker.chooseDateChoose date
uiKit.datePicker.todayToday
uiKit.datePicker.clearClear
uiKit.datePicker.hourHour
uiKit.datePicker.minuteMinute
uiKit.datePicker.increaseHourIncrease hour
uiKit.datePicker.decreaseHourDecrease hour
uiKit.datePicker.increaseMinuteIncrease minute
uiKit.datePicker.decreaseMinuteDecrease minute
uiKit.dataTable.selectAllSelect all rows
uiKit.dataTable.selectRowSelect row
uiKit.dataTable.collapseRowCollapse row
uiKit.dataTable.expandRowExpand row
uiKit.dataTable.loadingLoading…
uiKit.dataTable.columnWidth{label}: {width} pixels
uiKit.dataTable.sortedAscendingSorted by {label}, ascending
uiKit.dataTable.sortedDescendingSorted by {label}, descending
uiKit.dataTable.sortClearedSort cleared
uiKit.sortable.instructionsPress Space or Enter to start reordering. Use the arrow keys to move, Space to drop, Escape to cancel.
uiKit.sortable.grabbedGrabbed {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.droppedDropped {label} at position {position} of {total}.
uiKit.sortable.cancelledReordering cancelled. {label} returned to its original position.
uiKit.rating.valueText{value} of {max}
uiKit.slider.minimumMinimum
uiKit.slider.maximumMaximum
uiKit.calendar.weekNumberWeek {week}
uiKit.calendar.previousMonthPrevious month
uiKit.calendar.nextMonthNext month
uiKit.calendar.previousYearPrevious year
uiKit.calendar.nextYearNext year
uiKit.calendar.previousYearsPrevious years
uiKit.calendar.nextYearsNext years