Skip to content

Commit

Permalink
fix(next-international): flatten locale in getLocaleProps (#166)
Browse files Browse the repository at this point in the history
  • Loading branch information
lindesvard committed Sep 13, 2023
1 parent 2985fb7 commit 24a13d2
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type { ImportedLocales } from 'international-types';
import type { GetStaticProps, GetServerSideProps } from 'next';
import { error } from '../helpers/log';
import { flattenLocale } from '../common/flatten-locale';

export function createGetLocaleProps(locales: ImportedLocales) {
return function getLocaleProps<
Expand All @@ -23,7 +24,7 @@ export function createGetLocaleProps(locales: ImportedLocales) {
props: {
// @ts-expect-error Next `GetStaticPropsResult` doesn't have `props`
...initialResult?.props,
locale: (await load()).default,
locale: flattenLocale((await load()).default),
},
};
};
Expand Down

0 comments on commit 24a13d2

Please sign in to comment.