Vuetify:Internationalization
Creating a translation
전체 번역 목록 (2021-07-30 기준)
export default {
badge: 'Badge',
close: 'Close',
dataIterator: {
noResultsText: 'No matching records found',
loadingText: 'Loading items...',
},
dataTable: {
itemsPerPageText: 'Rows per page:',
ariaLabel: {
sortDescending: 'Sorted descending.',
sortAscending: 'Sorted ascending.',
sortNone: 'Not sorted.',
activateNone: 'Activate to remove sorting.',
activateDescending: 'Activate to sort descending.',
activateAscending: 'Activate to sort ascending.',
},
sortBy: 'Sort by',
},
dataFooter: {
itemsPerPageText: 'Items per page:',
itemsPerPageAll: 'All',
nextPage: 'Next page',
prevPage: 'Previous page',
firstPage: 'First page',
lastPage: 'Last page',
pageText: '{0}-{1} of {2}',
},
datePicker: {
itemsSelected: '{0} selected',
nextMonthAriaLabel: 'Next month',
nextYearAriaLabel: 'Next year',
prevMonthAriaLabel: 'Previous month',
prevYearAriaLabel: 'Previous year',
},
noDataText: 'No data available',
carousel: {
prev: 'Previous visual',
next: 'Next visual',
ariaLabel: {
delimiter: 'Carousel slide {0} of {1}',
},
},
calendar: {
moreEvents: '{0} more',
},
fileInput: {
counter: '{0} files',
counterSize: '{0} files ({1} in total)',
},
timePicker: {
am: 'AM',
pm: 'PM',
},
pagination: {
ariaLabel: {
wrapper: 'Pagination Navigation',
next: 'Next page',
previous: 'Previous page',
page: 'Goto Page {0}',
currentPage: 'Current Page, Page {0}',
},
},
rating: {
ariaLabel: {
icon: 'Rating {0} of {1}',
},
},
}
Vue i18n
If you are using the vue-i18n package, you can very easily integrate it with Vuetify. This allows you to keep all of your translations in one place. Simply create an entry for $vuetify within your messages and add the corresponding language changes. Then hook up vue-i18n to Vuetify by supplying a custom translation function (as seen in the example below). For a complete list of all available keys, navigate here.
An important note when using external localization plugins is that vuetify will not automatically fall back to using english if no localization exists for the current locale. So be sure to supply the plugin with the english localizations as well as your own.
// src/plugins/vuetify.js
import Vue from 'vue'
import Vuetify from 'vuetify/lib'
import VueI18n from 'vue-i18n'
Vue.use(Vuetify)
Vue.use(VueI18n)
const messages = {
en: {
$vuetify: {
dataIterator: {
rowsPerPageText: 'Items per page:',
pageText: '{0}-{1} of {2}',
},
},
},
sv: {
$vuetify: {
dataIterator: {
rowsPerPageText: 'Element per sida:',
pageText: '{0}-{1} av {2}',
},
},
},
}
// Create VueI18n instance with options
const i18n = new VueI18n({
locale: 'sv', // set locale
messages, // set locale messages
})
export default new Vuetify({
lang: {
t: (key, ...params) => i18n.t(key, params),
},
})