@nuxtjs/i18n module is installed and configured in your project.i18n option is enabled in the statamic module options.useStatamicI18nParams is a composable that processes route slugs for different locales and sets up internationalized parameters for dynamic routes and catch-all routes.
It will setup the dynamic internationalized parameters for the route using the useSetI18nParams composable from the @nuxtjs/i18n module.
<script setup lang="ts">
const { data, error } = await useStatamicPage();
useStatamicPageErrorHandler(error);
useStatamicI18nParams(data.value?.slugs);
</script>
You can also pass a custom slugs object to the composable.
<script setup lang="ts">
const { data, error } = await useStatamicPage();
useStatamicPageErrorHandler(error);
useStatamicI18nParams({
en: "/en/blog",
fr: "/fr/blog",
});
</script>
function useStatamicI18nParams(slugs: Record<string, string>)
It will also set the internationalized parameters for the route using the
useSetI18nParamscomposable from the@nuxtjs/i18nmodule.