Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into chore/next-15
Browse files Browse the repository at this point in the history
# Conflicts:
#	docs/package.json
#	docs/tsconfig.json
#	pnpm-lock.yaml
  • Loading branch information
amannn committed Jan 23, 2025
2 parents 5ff901e + b73f33d commit 9f56e2e
Show file tree
Hide file tree
Showing 213 changed files with 6,074 additions and 4,113 deletions.
29 changes: 15 additions & 14 deletions .github/ISSUE_TEMPLATE/01_bug_report.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,17 @@
name: Bug report
description: Create a bug report
labels:
- bug
- unconfirmed
- bug
- unconfirmed
body:
- type: markdown
attributes:
value: Thanks for taking the time to file a bug report!
- type: markdown
attributes:
value: |
**Creating a good bug report takes time.**
To help us resolve the issue quickly, please simplify the reproduction as much as possible by removing any unnecessary code, files, and dependencies that are not directly related to the problem. The easier it is for us to see the issue, the faster we can help you.
Thanks for taking the time to file a bug report!
**Please note:**
1. `next-intl` is based on Next.js, therefore bugs in Next.js might cause errors in apps that use `next-intl`. Please make sure that the bug you're experiencing is _caused by_ by `next-intl`. If you're unsure, please search on [the Next.js issue tracker](https://github.com/vercel/next.js/issues) for similar issues.
2. General usage questions are not bug reports. Please [submit usage questions on Stack Overflow](https://stackoverflow.com/questions/ask) instead.
1. General usage questions are not bug reports. If you're looking for support with your app, you can consider asking for help on the [Next.js Discord](https://discord.com/invite/nextjs), [Stack Overflow](https://stackoverflow.com/questions/ask) or [GitHub discussions](https://github.com/amannn/next-intl/discussions) instead.
2. `next-intl` is based on Next.js, therefore bugs in Next.js might cause errors in apps that use `next-intl`. Please make sure that the bug you're experiencing is _caused by_ by `next-intl`. If you're unsure, please search on [the Next.js issue tracker](https://github.com/vercel/next.js/issues) for similar issues.
3. Bug reports without a reproduction may be closed immediately.
- type: textarea
attributes:
Expand All @@ -28,11 +23,11 @@ body:
attributes:
label: Verifications
options:
- label: I've verified that the problem I'm experiencing isn't covered in [the docs](https://next-intl-docs.vercel.app/).
- label: I've verified that the problem I'm experiencing isn't covered in [the docs](https://next-intl.dev).
required: true
- label: I've searched for similar, existing issues on GitHub and [Stack Overflow](https://stackoverflow.com/search?q=next-intl).
- label: I've searched for similar, existing issues on [GitHub](https://github.com/amannn/next-intl/issues) and [Stack Overflow](https://stackoverflow.com/search?q=next-intl).
required: true
- label: I've compared my app to [a working example](https://next-intl-docs.vercel.app/examples) to look for differences.
- label: I've compared my app to [a working example](https://next-intl.dev/examples) to look for differences.
required: true
- type: input
attributes:
Expand All @@ -41,6 +36,12 @@ body:
**Templates:** [App Router](https://github.com/amannn/next-intl-bug-repro-app-router), [Pages Router](https://github.com/amannn/next-intl/tree/main/examples/example-pages-router)
validations:
required: true
- type: markdown
attributes:
value: |
**Creating a good reproduction takes time.**
To help us resolve the issue quickly, please simplify the reproduction as much as possible by removing any unnecessary code, files, and dependencies that are not directly related to the problem. The easier it is for us to see the issue, the faster we can help you.
- type: textarea
attributes:
label: Reproduction description
Expand All @@ -49,7 +50,7 @@ body:
Steps to reproduce:
1. Open reproduction
2. Click on …
3. See error: …
3. See error: …
validations:
required: true
- type: textarea
Expand Down
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/02_feature_request.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: Feature request
description: Suggest an idea for this project
labels:
- enhancement
- unconfirmed
- enhancement
- unconfirmed
body:
- type: markdown
attributes:
Expand Down
12 changes: 10 additions & 2 deletions .github/ISSUE_TEMPLATE/03_update_docs.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,23 @@
name: Update docs
description: Suggest an update to the docs
description: Suggest an update to a docs page
title: '[Docs]: '
labels:
- unconfirmed
- documentation
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to suggest an update to a docs page!
Please note that docs issues are meant to fix already existing documentation. If you're looking for support with your app, you can consider asking for help on the [Next.js Discord](https://discord.com/invite/nextjs), [Stack Overflow](https://stackoverflow.com/questions/ask) or [GitHub discussions](https://github.com/amannn/next-intl/discussions) instead.
- type: input
id: pageLink
attributes:
label: Link to page
description: A link to an existing page in the docs (if any)
description: A link to an existing page in the docs
validations:
required: true
- type: textarea
id: description
attributes:
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
blank_issues_enabled: false
contact_links:
- name: View documentation
url: https://next-intl-docs.vercel.app/
url: https://next-intl.dev
about: Check out the official docs for answers to common questions
- name: Get community support
url: https://stackoverflow.com/questions/ask
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/close-stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Close stale issues
on:
schedule:
# Once per day at midnight
- cron: "0 0 * * *"
- cron: '0 0 * * *'

permissions:
issues: write
Expand All @@ -16,7 +16,7 @@ jobs:
days-before-stale: 14
days-before-close: 0
any-of-labels: reproduction-missing,needs-isolation
stale-issue-message: "This issue has been automatically closed because it is currently not actionable and has become stale. If the problem persists, please create a new issue."
stale-issue-message: 'This issue has been automatically closed because it is currently not actionable and has become stale. If the problem persists, please create a new issue.'
close-stale:
runs-on: ubuntu-latest
steps:
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/issue-commenter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ jobs:
issue-number: ${{ github.event.issue.number }}
body: |
Thank you for your report!
Unfortunately, the reproduction is missing or incomplete, and as such we cannot investigate this issue. Please add a reproduction to the issue, otherwise it will be closed automatically.
**Templates:**
- [App Router](https://github.com/amannn/next-intl-bug-repro-app-router)
- [Pages Router](https://github.com/amannn/next-intl/tree/main/examples/example-pages-router)
**Creating a good bug report takes time.**
**Creating a good reproduction takes time.**
To help us resolve the issue quickly, please simplify the reproduction as much as possible by removing any unnecessary code, files, and dependencies that are not directly related to the problem. The easier it is for us to see the issue, the faster we can help you.
Apart from the reproduction, make sure to include the precise steps on how to reproduce the issue, e.g.:
Expand Down Expand Up @@ -53,7 +53,7 @@ jobs:
issue-number: ${{ github.event.issue.number }}
body: |
Thank you for your report!
From the currently available context in this issue, it's unclear wether the erroneous behavior is caused by Next.js, `next-intl` or a 3rd party library that you're using. Please isolate the issue further to be sure that the issue is _caused_ by `next-intl`. When in doubt, please search on [the Next.js issue tracker](https://github.com/vercel/next.js/issues) or related resources of 3rd party libraries you might be using.
If you're able to isolate the issue to `next-intl`, please provide a minimal reproduction that ideally doesn't involve any 3rd party libraries or alternatively demonstrates that `next-intl` is causing the issue.
Expand Down
28 changes: 21 additions & 7 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,12 @@ jobs:
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ vars.TURBO_TEAM }}
TURBO_SCM_BASE: ${{ github.event_name == 'pull_request' && (github.event.pull_request.base.sha || github.event.before) }}
steps:
# General setup
- uses: actions/checkout@v4
with:
fetch-depth: 0 # For Turborepo
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
Expand All @@ -23,13 +27,23 @@ jobs:
# Next.js caching
- uses: actions/cache@v4
with:
path: ${{ github.workspace }}/examples/*/.next/cache
path: |
${{ github.workspace }}/examples/*/.next/cache
${{ github.workspace }}/docs/.next/cache
key: ${{ runner.os }}-nextjs-${{ hashFiles('pnpm-lock.yaml') }}

# Setting up playwright in one example is sufficient
- run: pnpm --filter example-app-router-playground exec playwright install --with-deps
# Playwright (incl. caching)
- id: playwright-version
run: |
version=$(pnpm --filter example-app-router exec playwright --version | awk '{print $2}')
echo "version=$version" >> "$GITHUB_OUTPUT"
- uses: actions/cache@v4
id: playwright-cache
with:
path: ~/.cache/ms-playwright
key: ${{ runner.os }}-playwright-${{ steps.playwright-version.outputs.version }}
- run: pnpm --filter example-app-router exec playwright install --with-deps
if: steps.playwright-cache.outputs.cache-hit != 'true'

- run: pnpm run build
- run: pnpm run lint
- run: pnpm run test
- run: pnpm run size
# Main tasks
- run: pnpm turbo run lint build test size --affected
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ node_modules/
dist/
.next/
tsconfig.tsbuildinfo
.turbo
90 changes: 90 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,96 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## 3.26.3 (2024-12-20)

### Bug Fixes

* Add missing deprecation warnings for `next-intl@4.0` ([#1485](https://github.com/amannn/next-intl/issues/1485)) ([1d60d08](https://github.com/amannn/next-intl/commit/1d60d08c446d9eeac8bcc5bfbd0654113a737518)) – by @amannn

## 3.26.2 (2024-12-18)

### Bug Fixes

* Support `t.has` when `getTranslations` is called with an object argument ([#1616](https://github.com/amannn/next-intl/issues/1616)) ([64895a2](https://github.com/amannn/next-intl/commit/64895a2bb3c445f6e3deab85152a0d04ced17e46)), closes [/github.com/amannn/next-intl/discussions/437#discussioncomment-11593318](https://github.com/amannn//github.com/amannn/next-intl/discussions/437/issues/discussioncomment-11593318) – by @amannn

## 3.26.1 (2024-12-11)

### Bug Fixes

* Use new domain `next-intl.dev` in links ([#1601](https://github.com/amannn/next-intl/issues/1601)) ([40a9a77](https://github.com/amannn/next-intl/commit/40a9a7722edc8e7787ed799a4bf1d3c4a2e04848)) – by @amannn

## 3.26.0 (2024-12-06)

### Features

* Support React 19 ([#1597](https://github.com/amannn/next-intl/issues/1597)) ([e0ffe29](https://github.com/amannn/next-intl/commit/e0ffe292a3cae8955fcd06bd8e8e2b02c525ef69)) – by @amannn

## 3.25.3 (2024-11-26)

### Bug Fixes

* Follow-up for [#1573](https://github.com/amannn/next-intl/issues/1573) to also handle the case when a non-default locale is in use ([#1578](https://github.com/amannn/next-intl/issues/1578)) ([fd71741](https://github.com/amannn/next-intl/commit/fd7174179881a19e3573fceb9c6e903923644761)), closes [#1568](https://github.com/amannn/next-intl/issues/1568) – by @amannn

## 3.25.2 (2024-11-25)

### Bug Fixes

* Handle inconsistency in Next.js when using `usePathname` with custom prefixes, `localePrefix: 'as-needed'` and static rendering ([#1573](https://github.com/amannn/next-intl/issues/1573)) ([20fd0f0](https://github.com/amannn/next-intl/commit/20fd0f0015839357893bcd256ff880a98b01ea1f)) – by @amannn

## 3.25.1 (2024-11-13)

### Bug Fixes

* Correctly handle search params in redirects when using `trailingSlash: true` ([#1537](https://github.com/amannn/next-intl/issues/1537)) ([03a4620](https://github.com/amannn/next-intl/commit/03a4620432ff063b2b84f4dba5c49ae36b92fd73)) – by @deini

## 3.25.0 (2024-11-08)

### Features

* Add type exports to enable `declaration: true` in `tsconfig.json` ([#1509](https://github.com/amannn/next-intl/issues/1509)) ([6b2ca9c](https://github.com/amannn/next-intl/commit/6b2ca9cfddcf8611893f76f9690e0bafb534e8fd)) – by @osaton

## 3.24.0 (2024-10-31)

### Features

* Add support for React 19 RC ([#1490](https://github.com/amannn/next-intl/issues/1490)) ([2dea022](https://github.com/amannn/next-intl/commit/2dea02271f79e183dfd18a3c77112a79e1fce581)) – by @amannn

## 3.23.5 (2024-10-24)

### Bug Fixes

* Don't warn when setting `prefetch={true}` on `<Link />` ([#1463](https://github.com/amannn/next-intl/issues/1463)) ([fd6d73d](https://github.com/amannn/next-intl/commit/fd6d73dc145a0679e85a1a71fe40c43d3312e27e)), closes [#1462](https://github.com/amannn/next-intl/issues/1462) – by @amannn

## 3.23.4 (2024-10-24)

### Bug Fixes

* Upgrade to `negotiator@^1.0` ([#1460](https://github.com/amannn/next-intl/issues/1460)) ([b93f297](https://github.com/amannn/next-intl/commit/b93f29736250a749333d438b06b7a608e9d73c28)) – by @amannn

## 3.23.3 (2024-10-24)

### Bug Fixes

* Resolve locale for navigation APIs consistently from `i18n/request.ts` in `react-server` like all other APIs do ([#1459](https://github.com/amannn/next-intl/issues/1459)) ([8c6d5ff](https://github.com/amannn/next-intl/commit/8c6d5fff009ac3c54b2847c23b8148759d0b6ffa)) – by @amannn

## 3.23.2 (2024-10-22)

### Bug Fixes

* Handle inlined search params and hashes correctly in `<Link />` from `createNavigation` ([#1448](https://github.com/amannn/next-intl/issues/1448)) ([ba0a537](https://github.com/amannn/next-intl/commit/ba0a537571b49d2d31cbc3c5079a7ad738e1409b)) – by @amannn

## 3.23.1 (2024-10-22)

### Bug Fixes

* Remove usage of deprecated `ReactNodeArray` which is removed in React 19 ([#1445](https://github.com/amannn/next-intl/issues/1445)) ([2396345](https://github.com/amannn/next-intl/commit/23963458e3ef3d5d29eeb9df01f40bbe11245301)) – by @amannn

## 3.23.0 (2024-10-22)

### Features

* Add Next.js 15 to peer dependencies ([#1443](https://github.com/amannn/next-intl/issues/1443)) ([4cb22bb](https://github.com/amannn/next-intl/commit/4cb22bb10990961dba7e5accd2b5c70664f2b6d2)) – by @amannn

## 3.22.0 (2024-10-21)

### Features
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<h1 align="center">
<br>
<a href="https://next-intl-docs.vercel.app/">
<a href="https://next-intl.dev">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="media/logo-dark-mode.svg">
<source media="(prefers-color-scheme: light)" srcset="media/logo.svg">
Expand Down Expand Up @@ -29,10 +29,10 @@ Internationalization (i18n) is an essential part of the user experience, therefo
```jsx
// UserProfile.tsx
import {useTranslations} from 'next-intl';

export default function UserProfile({user}) {
const t = useTranslations('UserProfile');

return (
<section>
<h1>{t('title', {firstName: user.firstName})}</h1>
Expand All @@ -47,7 +47,7 @@ export default function UserProfile({user}) {
// en.json
{
"UserProfile": {
"title": "{username}'s profile",
"title": "{firstName}'s profile",
"membership": "Member since {memberSince, date, short}",
"followers": "{count, plural, ↵
=0 {No followers yet} ↵
Expand All @@ -58,10 +58,10 @@ export default function UserProfile({user}) {
}
```

### [→ Read the docs](https://next-intl-docs.vercel.app/)
### [→ Read the docs](https://next-intl.dev)

<div align="center">
<a href="https://next-intl-docs.vercel.app/redirect?href=https://crowdin.com" target="_blank">
<a href="https://next-intl.dev/redirect?href=https://crowdin.com" target="_blank">
<img width="350" src="media/partner.svg" alt="Crowdin logo">
</a>
<br>
Expand Down
5 changes: 0 additions & 5 deletions docs/components/Analytics.tsx

This file was deleted.

Loading

0 comments on commit 9f56e2e

Please sign in to comment.