
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
nextjs-i18n
Advanced tools
I18n hook and component for Next.js with support for plurals, Intl and React interpolation
I18n hook and component for Next.js with support for plurals, interpolations and JSX substitutions
npm i -S nextjs-i18n
<I18n />
Componentimport { I18n } from "nextjs-i18n"
function Component = () => (
<div>
<I18n en="Hello {{name}}" pt="Olá, {{name}}" params={{
name: "John Doe"
}} />
</div>
)
useI18n
hookimport { useI18n } from "nextjs-i18n"
function Component = () => {
const { t } = useI18n()
return (
<Header howdy={
t({
en: "Hello {{name}}",
pt: "Olá, {{name}}",
params: {
name: "John Doe",
},
})
} />
)
}
import { I18n } from "nextjs-i18n"
function Component = (articles: Article[]) => (
<div>
<I18n
en={{
0: "Zero articles",
1: "One article",
2: "Two articles",
n: "Many articles",
}}
pt={{
0: "Zero artigos",
1: "Um artigo",
2: "Dois artigos",
n: "Vários artigos",
}}
count={articles.length}
/>
</div>
)
import { I18n } from "nextjs-i18n"
function Component = (articles: Article[]) => (
<div>
<I18n
en="Hi, {{name}}. See your <link>messages</link> of <b>{{today locale}}</b>"
pt="Olá {{name}}. Acesse suas <link>mensagens</link> do dia <b>{{today locale}}</b>"
params={{
name: "Jane Doe",
link: <a href="/messages" />,
b: <strong />,
today: (format: string) => {
const today = new Date()
if (format === "locale") {
return today.toLocaleDateString()
}
return today.toDateString()
},
}}
/>
</div>
)
This is a list of things we want to provide in the future:
FAQs
I18n hook and component for Next.js with support for plurals, interpolations and JSX substitutions
The npm package nextjs-i18n receives a total of 5 weekly downloads. As such, nextjs-i18n popularity was classified as not popular.
We found that nextjs-i18n 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
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.