Add link to easy use on templates

This commit is contained in:
Quique Fdez Guerra 2017-12-01 13:33:33 +01:00 committed by GitHub
parent 06ae3868fe
commit ffecaee7bc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -14,4 +14,12 @@ export default ({ app, store }) => {
'fr': require('~/locales/fr.json')
}
})
app.i18n.link = (link) => {
if (app.i18n.locale === app.i18n.fallbackLocale) {
return `/${link}`
}
return `/${app.i18n.locale}/${link}`
}
}