Skip to content

i18n: pass locale to shop-api  #104

@redaready

Description

@redaready

is there a way to pass the locale value of "extractLang(request.headers.get('accept-language'), request.url)" to shop-api call?

i have tried something like this, but a error raised: "Internal server error: Reading locale outside of context."

const executeRequest = async (options: Options) => {
	const locale = getLocale();
	const httpResponse = await fetch(`${ENV_VARIABLES.VITE_VENDURE_PUBLIC_URL}/?languageCode=${locale}`, options);
	return await extractTokenAndData(httpResponse);
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions