Skip to content

Commit

Permalink
nt-96 parse params only when needed
Browse files Browse the repository at this point in the history
  • Loading branch information
vordgi committed May 14, 2024
1 parent 16c7b88 commit 605fb76
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion package/src/lib/loadI18nData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,14 @@ import { getParams } from "@nimpl/getters/get-params";

const loadI18nData = async (): Promise<{ dictionary: Translates; language: string }> => {
const config = await getConfig();
const language = await config.getLanguage({ pathname: getPathname(), params: getParams() });
const language = await config.getLanguage({
get pathname() {
return getPathname();
},
get params() {
return getParams();
},
});

if (!language || !config.languages.includes(language)) {
throw new Error(
Expand Down

0 comments on commit 605fb76

Please sign in to comment.