lagon
lagon copied to clipboard
fix(deps): update dependency next-international to ^0.8.0
This PR contains the following updates:
Package | Change | Age | Adoption | Passing | Confidence |
---|---|---|---|---|---|
next-international | ^0.6.4 -> ^0.8.0 |
Release Notes
QuiiBz/next-international (next-international)
v0.8.2
What's Changed
- chore: update middleware regex by @QuiiBz in https://github.com/QuiiBz/next-international/pull/98
- fix(next-international): use default locale when Accept-Language is unknown by @QuiiBz in https://github.com/QuiiBz/next-international/pull/101
Full Changelog: https://github.com/QuiiBz/next-international/compare/0.8.0...0.8.2
v0.8.1
v0.8.0
App Router
Rewrite the URL to hide the locale
You might have noticed that by default, next-international redirects and shows the locale in the URL (e.g /en/products
). This is helpful for users, but you can transparently rewrite the URL to hide the locale (e.g /products
).
Navigate to the middleware.ts
file and set the urlMappingStrategy
to rewrite
(the default is redirect
):
// middleware.ts
const I18nMiddleware = createI18nMiddleware(['en', 'fr'] as const, 'fr', {
urlMappingStrategy: 'rewrite'
})
useChangeLocale
with basePath
When using useChangeLocale
and if you have set a basePath
option inside next.config.js
, you'll also need to set it here:
const changeLocale = useChangeLocale({
basePath: '/your-base-path'
})
What's Changed
- fix(international-types): plural tags by @QuiiBz in https://github.com/QuiiBz/next-international/pull/80
- chore: improve README by @QuiiBz in https://github.com/QuiiBz/next-international/pull/82
- feat(next-international):
useParams
&rewrite
strategy to hide locale from URL by @EdmundKorley in https://github.com/QuiiBz/next-international/pull/83 - fix(international-types): plurals params with scope by @QuiiBz in https://github.com/QuiiBz/next-international/pull/88
- fix(next-international):
useChangeLocale
withbasePath
by @QuiiBz in https://github.com/QuiiBz/next-international/pull/90 - fix(next-international): derive plurals from fallback locale by @ArmanAryanpour in https://github.com/QuiiBz/next-international/pull/79
- fix(next-international): plural with scopes by @QuiiBz in https://github.com/QuiiBz/next-international/pull/91
New Contributors
- @EdmundKorley made their first contribution in https://github.com/QuiiBz/next-international/pull/83
- @ArmanAryanpour made their first contribution in https://github.com/QuiiBz/next-international/pull/79
Full Changelog: https://github.com/QuiiBz/next-international/compare/0.7.0...0.8.0
v0.7.0
Plurals
Plural translations work out of the box without any external dependencies, using the Intl.PluralRules
API, which is supported in all browsers and Node.js.
To declare plural translations, append #
followed by zero
, one
, two
, few
, many
or other
:
// locales/en.ts
export default {
'cows#one': 'A cow',
'cows#other': '{count} cows'
} as const
The correct translation will then be determined automatically using a mandatory count
parameter. This works with the Pages Router, App Router in both Client and Server Components, and with scoped translations:
export default function Page() {
const t = useI18n()
return (
<div>
{/* Output: A cow */}
<p>{t('cows', { count: 1 })}</p>
{/* Output: 3 cows */}
<p>{t('cows', { count: 3 })}</p>
</div>
)
}
What's Changed
- chore(next-international): remove peer dependencies by @QuiiBz in https://github.com/QuiiBz/next-international/pull/76
- feat: add plurals support by @QuiiBz in https://github.com/QuiiBz/next-international/pull/75
- feat: typesafe plural
count
by @QuiiBz in https://github.com/QuiiBz/next-international/pull/78
Full Changelog: https://github.com/QuiiBz/next-international/compare/0.6.4...0.7.0
Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
- [ ] If you want to rebase/retry this PR, check this box
This PR has been generated by Mend Renovate. View repository job log here.