@pyxo/quasar-app-extension-int
Version:
A Quasar app extension to add internationalization support.
36 lines (35 loc) • 1.2 kB
JavaScript
export function getChildRoutes({ langTag, qint, }) {
const prefix = langTag.replace(/-/g, '');
// Localized blog path.
const lcBlogPath = qint.localizeUrlPath({
urlPath: 'blog',
langTag,
msgKey: 'ps',
});
return [
{
path: '',
name: `${prefix}Index`,
component: () => import('../../../pages/common/index/Index.vue'),
},
{
path: lcBlogPath,
name: `${prefix}Blog`,
component: () => import('../../../pages/common/blog/post-lc-list/PostLcList.vue'),
beforeEnter: [
async () => {
// Example of lazy loading route specific translation messages.
await qint.loadVueI18nMsg({
langTag,
importMsg: async (langTag) => (await import(`../../../i18n/route-msgs/common/blog/${langTag}`)).default,
});
},
],
},
{
path: `${lcBlogPath}/:slug`,
name: `${prefix}BlogPostLc`,
component: () => import('../../../pages/common/blog/post-lc/PostLc.vue'),
},
];
}