Skip to content
This repository has been archived by the owner on May 16, 2024. It is now read-only.

Commit

Permalink
fix: localization cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
matejm committed Oct 30, 2023
1 parent 38d6678 commit 2048da8
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 12 deletions.
7 changes: 0 additions & 7 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,6 @@
"./src/**/*.{js,ts}": "KEBAB_CASE"
},
{ "ignoreMiddleExtensions": true }
],
"no-restricted-imports": [
"error",
{
"name": "react-i18next",
"message": "Do not import from react-i18next. Use i18n from next-i18next instead."
}
]
}
}
4 changes: 1 addition & 3 deletions scripts/validate-translations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,7 @@ function pairsWithoutPlural(obj: any) {

const validateDefaultLocale = () => {
if (!LOCALES.includes(defaultLocale)) {
console.error(
`Default locale '${defaultLocale}' in next-i18next.config.js is invalid.`,
);
console.error(`Default locale '${defaultLocale}' is invalid.`);
process.exit(1);
}
};
Expand Down
2 changes: 1 addition & 1 deletion src/i18n/test-safety.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ const TestSafety = () => {
t('test', { count: 1, invalidKey: 'invalid' });

// This one is valid
t('test', { count: 1 }); // <- if error is thrown here, update key to any valid key in src/i18n/en/common.json
t('test', { count: 1 }); // <- if error is thrown here, update key to any valid key in src/i18n/en/common.ts
};
1 change: 0 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
"next-env.d.ts",
"**/*.ts",
"**/*.tsx",
"next-i18next.config.js",
".next/types/**/*.ts",
"scripts/validate-translations.ts"
],
Expand Down

0 comments on commit 2048da8

Please sign in to comment.