
Security News
npm Adopts OIDC for Trusted Publishing in CI/CD Workflows
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
next-i18next-ext
Advanced tools
Extended next-i18next which allows you to use translations shared between pages and load them once. SSG and SSR work great too.
npm i next-i18next-ext
import { createGetInitialProps } from 'next-i18next-ext/server';
export default class _Document extends Document {
static getInitialProps = createGetInitialProps(['common']);
render() {
...
}
}
next-i18next
import { appWithTranslation } from 'next-i18next-ext';
const _App = ({ Component, pageProps }) => {
return <Component {...pageProps} />;
};
export default appWithTranslation(_App);
import { serverSideTranslations } from 'next-i18next-ext/server';
export const getStaticProps = async ({ locale }) => {
return {
props: {
...(await serverSideTranslations(locale, ['main-page'])),
},
};
};
import { useTranslation } from 'react-i18next';
export const Footer = () => {
const { t } = useTranslation('common');
return (
<footer>
{t('description')}
</footer>
);
};
const createGetInitialProps: (namespacesRequired?: string[], configOverride?: UserConfig | null, extraLocales?: string[] | false) => (ctx: DocumentContext, locale?: string) => DocumentInitialProps;
const serverSideTranslations: (initialLocale: string, namespacesRequired?: string[] | undefined, configOverride?: UserConfig | null, extraLocales?: string[] | false) => Promise<SSRConfig>;
const appWithTranslation: (App: any, configOverride?: UserConfig | null) => (appProps: any) => JSX.Element;
FAQs
Next integration with i18next
The npm package next-i18next-ext receives a total of 6,287 weekly downloads. As such, next-i18next-ext popularity was classified as popular.
We found that next-i18next-ext demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.
Security News
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.