Skip to content

Commit

Permalink
fix: Use new domain next-intl.dev in links (#1601)
Browse files Browse the repository at this point in the history
  • Loading branch information
amannn authored Dec 11, 2024
1 parent 529ce6e commit 40a9a77
Show file tree
Hide file tree
Showing 39 changed files with 68 additions and 68 deletions.
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/01_bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,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](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 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
10 changes: 5 additions & 5 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 @@ -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
4 changes: 2 additions & 2 deletions examples/example-app-router-mixed-routing/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ An example of how to achieve locale prefixes on public routes while reading the

**Relevant docs:**

1. [Setting up `next-intl` with i18n routing](https://next-intl-docs.vercel.app/docs/getting-started/app-router/with-i18n-routing)
2. [Setting up `next-intl` without i18n routing](https://next-intl-docs.vercel.app/docs/getting-started/app-router/without-i18n-routing)
1. [Setting up `next-intl` with i18n routing](https://next-intl.dev/docs/getting-started/app-router/with-i18n-routing)
2. [Setting up `next-intl` without i18n routing](https://next-intl.dev/docs/getting-started/app-router/without-i18n-routing)

**Relevant parts in app code:**

Expand Down
2 changes: 1 addition & 1 deletion examples/example-app-router-next-auth/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ An example that showcases the usage of `next-intl` together with Auth.js and the

**Credentials**: admin / admin

See [the corresponding docs for this example](https://next-intl-docs.vercel.app/docs/routing/middleware#example-auth-js).
See [the corresponding docs for this example](https://next-intl.dev/docs/routing/middleware#example-auth-js).

## Deploy your own

Expand Down
2 changes: 1 addition & 1 deletion examples/example-app-router-without-i18n-routing/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# example-app-router-without-i18n-routing

An example that showcases how an app can provide a locale in `i18n.ts` to `next-intl` in an App Router setup ([without i18n routing setup](https://next-intl-docs.vercel.app/docs/getting-started/app-router/without-i18n-routing)).
An example that showcases how an app can provide a locale in `i18n.ts` to `next-intl` in an App Router setup ([without i18n routing setup](https://next-intl.dev/docs/getting-started/app-router/without-i18n-routing)).

This app uses Server Actions in two places:

Expand Down
2 changes: 1 addition & 1 deletion examples/example-app-router/messages/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"links": {
"docs": {
"description": "Erfahre mehr über next-intl in der offiziellen Dokumentation.",
"href": "https://next-intl-docs.vercel.app/",
"href": "https://next-intl.dev",
"title": "Dokumentation"
},
"source": {
Expand Down
2 changes: 1 addition & 1 deletion examples/example-app-router/messages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"links": {
"docs": {
"description": "Learn more about next-intl in the official docs.",
"href": "https://next-intl-docs.vercel.app/",
"href": "https://next-intl.dev",
"title": "Docs"
},
"source": {
Expand Down
2 changes: 1 addition & 1 deletion examples/example-pages-router-advanced/src/pages/about.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export async function getServerSideProps({locale}: GetServerSidePropsContext) {
),
// Note that when `now` is passed to the app, you need to make sure the
// value is updated from time to time, so relative times are updated. See
// https://next-intl-docs.vercel.app/docs/usage/configuration#global-now-value
// https://next-intl.dev/docs/usage/configuration#global-now-value
now: new Date().getTime()
}
};
Expand Down
2 changes: 1 addition & 1 deletion examples/example-react-native/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

An example that showcases the usage of `use-intl` with React Native.

Please double check that [the runtime requirements](https://next-intl-docs.vercel.app/docs/environments/runtime-requirements) are fulfilled.
Please double check that [the runtime requirements](https://next-intl.dev/docs/environments/runtime-requirements) are fulfilled.

```
pnpm install
Expand Down
Binary file modified media/assets.sketch
Binary file not shown.
4 changes: 2 additions & 2 deletions packages/next-intl/.size-limit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@ const config: SizeLimitConfig = [
name: "import {createLocalizedPathnamesNavigation} from 'next-intl/navigation' (react-server)",
path: 'dist/production/navigation.react-server.js',
import: '{createLocalizedPathnamesNavigation}',
limit: '16.785 KB'
limit: '16.805 KB'
},
{
name: "import {createNavigation} from 'next-intl/navigation' (react-server)",
path: 'dist/production/navigation.react-server.js',
import: '{createNavigation}',
limit: '16.8 KB'
limit: '16.805 KB'
},
{
name: "import * from 'next-intl/server' (react-client)",
Expand Down
2 changes: 1 addition & 1 deletion packages/next-intl/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
],
"description": "Internationalization (i18n) for Next.js",
"license": "MIT",
"homepage": "https://next-intl-docs.vercel.app",
"homepage": "https://next-intl.dev",
"repository": {
"type": "git",
"url": "https://github.com/amannn/next-intl"
Expand Down
2 changes: 1 addition & 1 deletion packages/next-intl/src/config.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export default function getConfig() {
throw new Error(
"Couldn't find next-intl config file. Please follow the instructions at https://next-intl-docs.vercel.app/docs/getting-started/app-router"
"Couldn't find next-intl config file. Please follow the instructions at https://next-intl.dev/docs/getting-started/app-router"
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import useBasePathname from './useBasePathname';
import useBaseRouter from './useBaseRouter';

/**
* @deprecated Consider switching to `createNavigation` (see https://next-intl-docs.vercel.app/blog/next-intl-3-22#create-navigation)
* @deprecated Consider switching to `createNavigation` (see https://next-intl.dev/blog/next-intl-3-22#create-navigation)
**/
export default function createLocalizedPathnamesNavigation<
AppLocales extends Locales,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export default function createNavigation<
routing
);

/** @see https://next-intl-docs.vercel.app/docs/routing/navigation#usepathname */
/** @see https://next-intl.dev/docs/routing/navigation#usepathname */
function usePathname(): [AppPathnames] extends [never]
? string
: keyof AppPathnames {
Expand Down Expand Up @@ -117,17 +117,17 @@ export default function createNavigation<

return {
...router,
/** @see https://next-intl-docs.vercel.app/docs/routing/navigation#userouter */
/** @see https://next-intl.dev/docs/routing/navigation#userouter */
push: createHandler<
Parameters<typeof router.push>[1],
typeof router.push
>(router.push),
/** @see https://next-intl-docs.vercel.app/docs/routing/navigation#userouter */
/** @see https://next-intl.dev/docs/routing/navigation#userouter */
replace: createHandler<
Parameters<typeof router.replace>[1],
typeof router.replace
>(router.replace),
/** @see https://next-intl-docs.vercel.app/docs/routing/navigation#userouter */
/** @see https://next-intl.dev/docs/routing/navigation#userouter */
prefetch: createHandler<
Parameters<typeof router.prefetch>[1],
typeof router.prefetch
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import useBasePathname from './useBasePathname';
import useBaseRouter from './useBaseRouter';

/**
* @deprecated Consider switching to `createNavigation` (see https://next-intl-docs.vercel.app/blog/next-intl-3-22#create-navigation)
* @deprecated Consider switching to `createNavigation` (see https://next-intl.dev/blog/next-intl-3-22#create-navigation)
**/
export default function createSharedPathnamesNavigation<
AppLocales extends Locales,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,11 @@ export default function createSharedNavigationFns<
ComponentProps<typeof BaseLink>,
'href' | 'localePrefix' | 'unprefixed' | 'defaultLocale' | 'localeCookie'
> & {
/** @see https://next-intl-docs.vercel.app/docs/routing/navigation#link */
/** @see https://next-intl.dev/docs/routing/navigation#link */
href: [AppPathnames] extends [never]
? ComponentProps<typeof BaseLink>['href']
: HrefOrUrlObjectWithParams<Pathname>;
/** @see https://next-intl-docs.vercel.app/docs/routing/navigation#link */
/** @see https://next-intl.dev/docs/routing/navigation#link */
locale?: string;
}
>;
Expand Down Expand Up @@ -181,15 +181,15 @@ export default function createSharedNavigationFns<
: {
/**
* In case you're using `localePrefix: 'as-needed'` in combination with `domains`, the `defaultLocale` can differ by domain and therefore the locales that need to be prefixed can differ as well. For this particular case, this parameter should be provided in order to compute the correct pathname. Note that the actual domain is not part of the result, but only the pathname is returned.
* @see https://next-intl-docs.vercel.app/docs/routing/navigation#getpathname
* @see https://next-intl.dev/docs/routing/navigation#getpathname
*/
domain: AppDomains[number]['domain'];
}
: {};

function getPathname(
args: {
/** @see https://next-intl-docs.vercel.app/docs/routing/navigation#getpathname */
/** @see https://next-intl.dev/docs/routing/navigation#getpathname */
href: [AppPathnames] extends [never]
? string | {pathname: string; query?: QueryParams}
: HrefOrHrefWithParams<keyof AppPathnames>;
Expand Down Expand Up @@ -233,7 +233,7 @@ export default function createSharedNavigationFns<
function getRedirectFn(
fn: typeof nextRedirect | typeof nextPermanentRedirect
) {
/** @see https://next-intl-docs.vercel.app/docs/routing/navigation#redirect */
/** @see https://next-intl.dev/docs/routing/navigation#redirect */
return function redirectFn(
args: Omit<Parameters<typeof getPathname>[0], 'domain'> &
Partial<DomainConfigForAsNeeded>,
Expand Down
2 changes: 1 addition & 1 deletion packages/next-intl/src/navigation/shared/utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ export function applyPathnamePrefix<
} else if (process.env.NODE_ENV !== 'production') {
if (!domain) {
console.error(
"You're using a routing configuration with `localePrefix: 'as-needed'` in combination with `domains`. In order to compute a correct pathname, you need to provide a `domain` parameter.\n\nSee: https://next-intl-docs.vercel.app/docs/routing#domains-localeprefix-asneeded"
"You're using a routing configuration with `localePrefix: 'as-needed'` in combination with `domains`. In order to compute a correct pathname, you need to provide a `domain` parameter.\n\nSee: https://next-intl.dev/docs/routing#domains-localeprefix-asneeded"
);
} else {
// If a domain was provided, but it wasn't found in the routing
Expand Down
4 changes: 2 additions & 2 deletions packages/next-intl/src/plugin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ function resolveI18nPath(providedPath?: string, cwd?: string) {
if (pathExists(candidate)) {
if (!hasWarnedForDeprecatedI18nConfig) {
console.warn(
`\n[next-intl] Reading request configuration from ${candidate} is deprecated, please see https://next-intl-docs.vercel.app/blog/next-intl-3-22#i18n-request — you can either move your configuration to ./i18n/request.ts or provide a custom path in your Next.js config:
`\n[next-intl] Reading request configuration from ${candidate} is deprecated, please see https://next-intl.dev/blog/next-intl-3-22#i18n-request — you can either move your configuration to ./i18n/request.ts or provide a custom path in your Next.js config:
const withNextIntl = createNextIntlPlugin(
'./path/to/i18n/request.tsx'
Expand All @@ -78,7 +78,7 @@ const withNextIntl = createNextIntlPlugin(
function initPlugin(i18nPath?: string, nextConfig?: NextConfig): NextConfig {
if (nextConfig?.i18n != null) {
console.warn(
"\n[next-intl] An `i18n` property was found in your Next.js config. This likely causes conflicts and should therefore be removed if you use the App Router.\n\nIf you're in progress of migrating from the Pages Router, you can refer to this example: https://next-intl-docs.vercel.app/examples#app-router-migration\n"
"\n[next-intl] An `i18n` property was found in your Next.js config. This likely causes conflicts and should therefore be removed if you use the App Router.\n\nIf you're in progress of migrating from the Pages Router, you can refer to this example: https://next-intl.dev/examples#app-router-migration\n"
);
}

Expand Down
2 changes: 1 addition & 1 deletion packages/next-intl/src/react-client/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ This can happen because:
failed, and therefore React attempted to render the component on the client
instead. If this is the case, check the console for server errors.
2) You intended to render this component on the client side, but no context was found.
Learn more about this error here: https://next-intl-docs.vercel.app/docs/environments/server-client-components#missing-context`
Learn more about this error here: https://next-intl.dev/docs/environments/server-client-components#missing-context`
: undefined
);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/next-intl/src/react-server/useConfig.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function useHook<Value>(hookName: string, promise: Promise<Value>) {
error.message.includes("Cannot read properties of null (reading 'use')")
) {
throw new Error(
`\`${hookName}\` is not callable within an async component. Please refer to https://next-intl-docs.vercel.app/docs/environments/server-client-components#async-components`,
`\`${hookName}\` is not callable within an async component. Please refer to https://next-intl.dev/docs/environments/server-client-components#async-components`,
{cause: error}
);
} else {
Expand Down
16 changes: 8 additions & 8 deletions packages/next-intl/src/routing/config.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,43 +32,43 @@ export type RoutingConfig<
> = {
/**
* All available locales.
* @see https://next-intl-docs.vercel.app/docs/routing
* @see https://next-intl.dev/docs/routing
*/
locales: AppLocales;

/**
* Used when no locale matches.
* @see https://next-intl-docs.vercel.app/docs/routing
* @see https://next-intl.dev/docs/routing
*/
defaultLocale: AppLocales[number];

/**
* Configures whether and which prefix is shown for a given locale.
* @see https://next-intl-docs.vercel.app/docs/routing#locale-prefix
* @see https://next-intl.dev/docs/routing#locale-prefix
**/
localePrefix?: LocalePrefix<AppLocales, AppLocalePrefixMode>;

/**
* Can be used to change the locale handling per domain.
* @see https://next-intl-docs.vercel.app/docs/routing#domains
* @see https://next-intl.dev/docs/routing#domains
**/
domains?: AppDomains;

/**
* Can be used to disable the locale cookie or to customize it.
* @see https://next-intl-docs.vercel.app/docs/routing/middleware#locale-cookie
* @see https://next-intl.dev/docs/routing/middleware#locale-cookie
*/
localeCookie?: boolean | CookieAttributes;

/**
* Sets the `Link` response header to notify search engines about content in other languages (defaults to `true`). See https://developers.google.com/search/docs/specialty/international/localized-versions#http
* @see https://next-intl-docs.vercel.app/docs/routing/middleware#alternate-links
* @see https://next-intl.dev/docs/routing/middleware#alternate-links
**/
alternateLinks?: boolean;

/**
* By setting this to `false`, the cookie as well as the `accept-language` header will no longer be used for locale detection.
* @see https://next-intl-docs.vercel.app/docs/routing/middleware#locale-detection
* @see https://next-intl.dev/docs/routing/middleware#locale-detection
**/
localeDetection?: boolean;
} & ([AppPathnames] extends [never]
Expand All @@ -77,7 +77,7 @@ export type RoutingConfig<
: {
/**
* A map of localized pathnames per locale.
* @see https://next-intl-docs.vercel.app/docs/routing#pathnames
* @see https://next-intl.dev/docs/routing#pathnames
**/
pathnames: AppPathnames;
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ async function getLocaleFromHeaderImpl(): Promise<string | undefined> {
(error as any).digest === 'DYNAMIC_SERVER_USAGE'
) {
const wrappedError = new Error(
'Usage of next-intl APIs in Server Components currently opts into dynamic rendering. This limitation will eventually be lifted, but as a stopgap solution, you can use the `setRequestLocale` API to enable static rendering, see https://next-intl-docs.vercel.app/docs/getting-started/app-router/with-i18n-routing#static-rendering',
'Usage of next-intl APIs in Server Components currently opts into dynamic rendering. This limitation will eventually be lifted, but as a stopgap solution, you can use the `setRequestLocale` API to enable static rendering, see https://next-intl.dev/docs/getting-started/app-router/with-i18n-routing#static-rendering',
{cause: error}
);
(wrappedError as any).digest = (error as any).digest;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function getLocaleFromHeaderImpl() {
(error as any).digest === 'DYNAMIC_SERVER_USAGE'
) {
throw new Error(
'Usage of next-intl APIs in Server Components currently opts into dynamic rendering. This limitation will eventually be lifted, but as a stopgap solution, you can use the `setRequestLocale` API to enable static rendering, see https://next-intl-docs.vercel.app/docs/getting-started/app-router/with-i18n-routing#static-rendering',
'Usage of next-intl APIs in Server Components currently opts into dynamic rendering. This limitation will eventually be lifted, but as a stopgap solution, you can use the `setRequestLocale` API to enable static rendering, see https://next-intl.dev/docs/getting-started/app-router/with-i18n-routing#static-rendering',
{cause: error}
);
} else {
Expand All @@ -33,7 +33,7 @@ function getLocaleFromHeaderImpl() {
if (!locale) {
if (process.env.NODE_ENV !== 'production') {
console.error(
`\nUnable to find \`next-intl\` locale because the middleware didn't run on this request. See https://next-intl-docs.vercel.app/docs/routing/middleware#unable-to-find-locale. The \`notFound()\` function will be called as a result.\n`
`\nUnable to find \`next-intl\` locale because the middleware didn't run on this request. See https://next-intl.dev/docs/routing/middleware#unable-to-find-locale. The \`notFound()\` function will be called as a result.\n`
);
}
notFound();
Expand Down
Loading

0 comments on commit 40a9a77

Please sign in to comment.