Skip to content

Commit

Permalink
flatten locale in getLocaleProps
Browse files Browse the repository at this point in the history
  • Loading branch information
lindesvard committed Sep 13, 2023
1 parent 82b12a0 commit d6394e5
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 d6394e5

Please sign in to comment.