baked-recipe-admin
Version:
Baked is an opinionated framework for .NET in backend and Nuxt in frontend. This is a recipe package that brings together all the components one needs for an Admin UI.
19 lines (15 loc) • 417 B
JavaScript
import { defineNuxtPlugin } from "#app";
export default defineNuxtPlugin({
name: "localization",
enforce: "pre",
setup(nuxtApp) {
const { $fetchInterceptors } = nuxtApp;
$fetchInterceptors.register(
"localization",
async({ options }, next) => {
options.headers["Accept-Language"] = nuxtApp.$i18n.locale.value;
return await next();
}
);
}
});