Skip to content

Commit b32b06b

Browse files
committed
Add language to the top level of page context so it can be used as a page query variable
Signed-off-by: Dmitriy Nevzorov <[email protected]>
1 parent 8d76764 commit b32b06b

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

src/plugin/onCreatePage.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ export const onCreatePage = async (
4242
path: newPath,
4343
context: {
4444
...page.context,
45+
language,
4546
i18n: {
4647
language,
4748
languages,

src/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,6 @@ export type I18NextContext = {
2525

2626
export type PageContext = {
2727
path: string;
28+
language: string;
2829
i18n: I18NextContext & {resources: Resources};
2930
};

0 commit comments

Comments
 (0)