next-intl 2.17.4 → 2.17.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_virtual/next-intl.esm.js +29 -0
- package/dist/_virtual/next-intl.esm.js.map +1 -0
- package/dist/client/NextIntlClientProvider.d.ts +4 -8
- package/dist/client/index.d.ts +6 -7
- package/dist/client/useClientLocale.d.ts +1 -3
- package/dist/client/usePathname.d.ts +14 -16
- package/dist/client/useRouter.d.ts +24 -28
- package/dist/index.d.ts +8 -3
- package/dist/index.js +8 -2
- package/dist/link/Link.d.ts +27 -30
- package/dist/link/index.d.ts +1 -4
- package/dist/middleware/NextIntlMiddlewareConfig.d.ts +28 -29
- package/dist/middleware/getAlternateLinksHeaderValue.d.ts +6 -9
- package/dist/middleware/index.d.ts +4 -3
- package/dist/middleware/middleware.d.ts +3 -6
- package/dist/middleware/resolveLocale.d.ts +6 -9
- package/dist/middleware/utils.d.ts +5 -8
- package/dist/next-intl.cjs.development.js +82 -0
- package/dist/next-intl.cjs.development.js.map +1 -0
- package/dist/next-intl.cjs.production.min.js +2 -0
- package/dist/next-intl.cjs.production.min.js.map +1 -0
- package/dist/{index.d.mts → next-intl.esm.js} +2 -2
- package/dist/next-intl.esm.js.map +1 -0
- package/dist/react-client/index.d.ts +12 -3
- package/dist/react-server/index.d.ts +17 -23
- package/dist/server/index.d.ts +6 -7
- package/dist/shared/BaseLink.d.ts +7 -9
- package/dist/shared/NextIntlClientProvider.d.ts +9 -11
- package/dist/shared/constants.d.ts +2 -4
- package/dist/shared/next-intl.esm.js +41 -0
- package/dist/shared/next-intl.esm.js.map +1 -0
- package/dist/shared/utils.d.ts +15 -16
- package/dist/src/client/NextIntlClientProvider.d.ts +4 -0
- package/dist/src/client/NextIntlClientProvider.js +16 -0
- package/dist/src/client/NextIntlClientProvider.js.map +1 -0
- package/dist/src/client/index.d.ts +6 -0
- package/dist/src/client/index.js +8 -0
- package/dist/src/client/index.js.map +1 -0
- package/dist/src/client/useClientLocale.d.ts +1 -0
- package/dist/src/client/useClientLocale.js +18 -0
- package/dist/src/client/useClientLocale.js.map +1 -0
- package/dist/{client/usePathname.d.mts → src/client/usePathname.d.ts} +1 -3
- package/dist/src/client/usePathname.js +34 -0
- package/dist/src/client/usePathname.js.map +1 -0
- package/dist/src/client/useRouter.d.ts +24 -0
- package/dist/src/client/useRouter.js +42 -0
- package/dist/src/client/useRouter.js.map +1 -0
- package/dist/src/index.d.ts +8 -0
- package/dist/src/index.js +9 -0
- package/dist/src/index.js.map +1 -0
- package/dist/{link/Link.d.mts → src/link/Link.d.ts} +3 -6
- package/dist/src/link/Link.js +29 -0
- package/dist/src/link/Link.js.map +1 -0
- package/dist/src/link/index.d.ts +1 -0
- package/dist/src/link/index.js +2 -0
- package/dist/src/link/index.js.map +1 -0
- package/dist/{middleware/NextIntlMiddlewareConfig.d.mts → src/middleware/NextIntlMiddlewareConfig.d.ts} +3 -4
- package/dist/src/middleware/NextIntlMiddlewareConfig.js +2 -0
- package/dist/src/middleware/NextIntlMiddlewareConfig.js.map +1 -0
- package/dist/{middleware/getAlternateLinksHeaderValue.d.mts → src/middleware/getAlternateLinksHeaderValue.d.ts} +2 -5
- package/dist/src/middleware/getAlternateLinksHeaderValue.js +64 -0
- package/dist/src/middleware/getAlternateLinksHeaderValue.js.map +1 -0
- package/dist/src/middleware/index.d.ts +4 -0
- package/dist/src/middleware/index.js +5 -0
- package/dist/src/middleware/index.js.map +1 -0
- package/dist/src/middleware/middleware.d.ts +3 -0
- package/dist/src/middleware/middleware.js +142 -0
- package/dist/src/middleware/middleware.js.map +1 -0
- package/dist/src/middleware/resolveLocale.d.ts +6 -0
- package/dist/src/middleware/resolveLocale.js +88 -0
- package/dist/src/middleware/resolveLocale.js.map +1 -0
- package/dist/src/middleware/utils.d.ts +5 -0
- package/dist/src/middleware/utils.js +37 -0
- package/dist/src/middleware/utils.js.map +1 -0
- package/dist/src/react-client/index.d.ts +12 -0
- package/dist/src/react-client/index.js +14 -0
- package/dist/src/react-client/index.js.map +1 -0
- package/dist/src/react-server/index.d.ts +17 -0
- package/dist/src/react-server/index.js +25 -0
- package/dist/src/react-server/index.js.map +1 -0
- package/dist/src/server/index.d.ts +6 -0
- package/dist/src/server/index.js +30 -0
- package/dist/src/server/index.js.map +1 -0
- package/dist/{shared/BaseLink.d.mts → src/shared/BaseLink.d.ts} +1 -3
- package/dist/src/shared/BaseLink.js +38 -0
- package/dist/src/shared/BaseLink.js.map +1 -0
- package/dist/{shared/NextIntlClientProvider.d.mts → src/shared/NextIntlClientProvider.d.ts} +2 -4
- package/dist/src/shared/NextIntlClientProvider.js +33 -0
- package/dist/src/shared/NextIntlClientProvider.js.map +1 -0
- package/dist/src/shared/constants.d.ts +2 -0
- package/dist/src/shared/constants.js +6 -0
- package/dist/src/shared/constants.js.map +1 -0
- package/dist/src/shared/utils.d.ts +15 -0
- package/dist/src/shared/utils.js +53 -0
- package/dist/src/shared/utils.js.map +1 -0
- package/package.json +27 -26
- package/src/react-server/index.tsx +2 -2
- package/dist/client/NextIntlClientProvider.d.mts +0 -8
- package/dist/client/NextIntlClientProvider.js +0 -2
- package/dist/client/NextIntlClientProvider.js.map +0 -1
- package/dist/client/NextIntlClientProvider.mjs +0 -2
- package/dist/client/NextIntlClientProvider.mjs.map +0 -1
- package/dist/client/index.d.mts +0 -7
- package/dist/client/index.js +0 -2
- package/dist/client/index.js.map +0 -1
- package/dist/client/index.mjs +0 -2
- package/dist/client/index.mjs.map +0 -1
- package/dist/client/useClientLocale.d.mts +0 -3
- package/dist/client/useClientLocale.js +0 -2
- package/dist/client/useClientLocale.js.map +0 -1
- package/dist/client/useClientLocale.mjs +0 -2
- package/dist/client/useClientLocale.mjs.map +0 -1
- package/dist/client/usePathname.js +0 -2
- package/dist/client/usePathname.js.map +0 -1
- package/dist/client/usePathname.mjs +0 -2
- package/dist/client/usePathname.mjs.map +0 -1
- package/dist/client/useRouter.d.mts +0 -28
- package/dist/client/useRouter.js +0 -2
- package/dist/client/useRouter.js.map +0 -1
- package/dist/client/useRouter.mjs +0 -2
- package/dist/client/useRouter.mjs.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/index.mjs +0 -2
- package/dist/index.mjs.map +0 -1
- package/dist/link/Link.js +0 -2
- package/dist/link/Link.js.map +0 -1
- package/dist/link/Link.mjs +0 -2
- package/dist/link/Link.mjs.map +0 -1
- package/dist/link/index.d.mts +0 -4
- package/dist/link/index.js +0 -2
- package/dist/link/index.js.map +0 -1
- package/dist/link/index.mjs +0 -2
- package/dist/link/index.mjs.map +0 -1
- package/dist/middleware/NextIntlMiddlewareConfig.js +0 -2
- package/dist/middleware/NextIntlMiddlewareConfig.js.map +0 -1
- package/dist/middleware/NextIntlMiddlewareConfig.mjs +0 -1
- package/dist/middleware/NextIntlMiddlewareConfig.mjs.map +0 -1
- package/dist/middleware/getAlternateLinksHeaderValue.js +0 -2
- package/dist/middleware/getAlternateLinksHeaderValue.js.map +0 -1
- package/dist/middleware/getAlternateLinksHeaderValue.mjs +0 -2
- package/dist/middleware/getAlternateLinksHeaderValue.mjs.map +0 -1
- package/dist/middleware/index.d.mts +0 -3
- package/dist/middleware/index.js +0 -2
- package/dist/middleware/index.js.map +0 -1
- package/dist/middleware/index.mjs +0 -2
- package/dist/middleware/index.mjs.map +0 -1
- package/dist/middleware/middleware.d.mts +0 -6
- package/dist/middleware/middleware.js +0 -2
- package/dist/middleware/middleware.js.map +0 -1
- package/dist/middleware/middleware.mjs +0 -2
- package/dist/middleware/middleware.mjs.map +0 -1
- package/dist/middleware/resolveLocale.d.mts +0 -9
- package/dist/middleware/resolveLocale.js +0 -2
- package/dist/middleware/resolveLocale.js.map +0 -1
- package/dist/middleware/resolveLocale.mjs +0 -2
- package/dist/middleware/resolveLocale.mjs.map +0 -1
- package/dist/middleware/utils.d.mts +0 -8
- package/dist/middleware/utils.js +0 -2
- package/dist/middleware/utils.js.map +0 -1
- package/dist/middleware/utils.mjs +0 -2
- package/dist/middleware/utils.mjs.map +0 -1
- package/dist/react-client/index.d.mts +0 -3
- package/dist/react-client/index.js +0 -2
- package/dist/react-client/index.js.map +0 -1
- package/dist/react-client/index.mjs +0 -2
- package/dist/react-client/index.mjs.map +0 -1
- package/dist/react-server/index.d.mts +0 -23
- package/dist/react-server/index.js +0 -7
- package/dist/react-server/index.js.map +0 -1
- package/dist/react-server/index.mjs +0 -7
- package/dist/react-server/index.mjs.map +0 -1
- package/dist/server/index.d.mts +0 -7
- package/dist/server/index.js +0 -14
- package/dist/server/index.js.map +0 -1
- package/dist/server/index.mjs +0 -14
- package/dist/server/index.mjs.map +0 -1
- package/dist/shared/BaseLink.js +0 -2
- package/dist/shared/BaseLink.js.map +0 -1
- package/dist/shared/BaseLink.mjs +0 -2
- package/dist/shared/BaseLink.mjs.map +0 -1
- package/dist/shared/NextIntlClientProvider.js +0 -2
- package/dist/shared/NextIntlClientProvider.js.map +0 -1
- package/dist/shared/NextIntlClientProvider.mjs +0 -2
- package/dist/shared/NextIntlClientProvider.mjs.map +0 -1
- package/dist/shared/constants.d.mts +0 -4
- package/dist/shared/constants.js +0 -2
- package/dist/shared/constants.js.map +0 -1
- package/dist/shared/constants.mjs +0 -2
- package/dist/shared/constants.mjs.map +0 -1
- package/dist/shared/utils.d.mts +0 -16
- package/dist/shared/utils.js +0 -2
- package/dist/shared/utils.js.map +0 -1
- package/dist/shared/utils.mjs +0 -2
- package/dist/shared/utils.mjs.map +0 -1
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
function _extends() {
|
|
2
|
+
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
3
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
4
|
+
var source = arguments[i];
|
|
5
|
+
for (var key in source) {
|
|
6
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
7
|
+
target[key] = source[key];
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
return target;
|
|
12
|
+
};
|
|
13
|
+
return _extends.apply(this, arguments);
|
|
14
|
+
}
|
|
15
|
+
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
16
|
+
if (source == null) return {};
|
|
17
|
+
var target = {};
|
|
18
|
+
var sourceKeys = Object.keys(source);
|
|
19
|
+
var key, i;
|
|
20
|
+
for (i = 0; i < sourceKeys.length; i++) {
|
|
21
|
+
key = sourceKeys[i];
|
|
22
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
23
|
+
target[key] = source[key];
|
|
24
|
+
}
|
|
25
|
+
return target;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export { _extends as extends, _objectWithoutPropertiesLoose as objectWithoutPropertiesLoose };
|
|
29
|
+
//# sourceMappingURL=next-intl.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"next-intl.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
import { ComponentProps } from 'react';
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
/** @deprecated Should be imported from `next-intl`, not `next-intl/client`. */
|
|
6
|
-
declare function NextIntlClientProvider(props: ComponentProps<typeof NextIntlClientProvider$1>): JSX.Element;
|
|
7
|
-
|
|
8
|
-
export { NextIntlClientProvider as default };
|
|
1
|
+
import { ComponentProps } from 'react';
|
|
2
|
+
import NextIntlClientProvider_ from '../shared/NextIntlClientProvider';
|
|
3
|
+
/** @deprecated Should be imported from `next-intl`, not `next-intl/client`. */
|
|
4
|
+
export default function NextIntlClientProvider(props: ComponentProps<typeof NextIntlClientProvider_>): JSX.Element;
|
package/dist/client/index.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
import 'use-intl';
|
|
1
|
+
/**
|
|
2
|
+
* Client-only APIs available via `next-intl/client`.
|
|
3
|
+
*/
|
|
4
|
+
export { default as useRouter } from './useRouter';
|
|
5
|
+
export { default as usePathname } from './usePathname';
|
|
6
|
+
export { default as NextIntlClientProvider } from './NextIntlClientProvider';
|
|
@@ -1,16 +1,14 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Returns the pathname without a potential locale prefix.
|
|
3
|
-
*
|
|
4
|
-
* @example
|
|
5
|
-
* ```tsx
|
|
6
|
-
* 'use client';
|
|
7
|
-
*
|
|
8
|
-
* import {usePathname} from 'next-intl/client';
|
|
9
|
-
*
|
|
10
|
-
* // When the user is on `/en`, this will be `/`
|
|
11
|
-
* const pathname = usePathname();
|
|
12
|
-
* ```
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
export { usePathname as default };
|
|
1
|
+
/**
|
|
2
|
+
* Returns the pathname without a potential locale prefix.
|
|
3
|
+
*
|
|
4
|
+
* @example
|
|
5
|
+
* ```tsx
|
|
6
|
+
* 'use client';
|
|
7
|
+
*
|
|
8
|
+
* import {usePathname} from 'next-intl/client';
|
|
9
|
+
*
|
|
10
|
+
* // When the user is on `/en`, this will be `/`
|
|
11
|
+
* const pathname = usePathname();
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
14
|
+
export default function usePathname(): string;
|
|
@@ -1,28 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* '
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
refresh(): void;
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
export { useRouter as default };
|
|
1
|
+
/**
|
|
2
|
+
* Returns a wrapped instance of `useRouter` from `next/navigation` that
|
|
3
|
+
* will automatically localize the `href` parameters it receives.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* ```tsx
|
|
7
|
+
* 'use client';
|
|
8
|
+
*
|
|
9
|
+
* import {useRouter} from 'next-intl/client';
|
|
10
|
+
*
|
|
11
|
+
* const router = useRouter();
|
|
12
|
+
*
|
|
13
|
+
* // When the user is on `/en`, the router will navigate to `/en/about`
|
|
14
|
+
* router.push('/about');
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
export default function useRouter(): {
|
|
18
|
+
push(href: string, options?: import("next/dist/shared/lib/app-router-context").NavigateOptions | undefined): void;
|
|
19
|
+
replace(href: string, options?: import("next/dist/shared/lib/app-router-context").NavigateOptions | undefined): void;
|
|
20
|
+
prefetch(href: string, options?: import("next/dist/shared/lib/app-router-context").PrefetchOptions | undefined): void;
|
|
21
|
+
back(): void;
|
|
22
|
+
forward(): void;
|
|
23
|
+
refresh(): void;
|
|
24
|
+
};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
/**
|
|
2
|
+
* This is the default entry file when consumers import from
|
|
3
|
+
* 'next-intl'. We use the client APIs in this case.
|
|
4
|
+
*
|
|
5
|
+
* Note that the `react-server` environment (i.e. RSC) imports
|
|
6
|
+
* from `./react-server` instead.
|
|
7
|
+
*/
|
|
8
|
+
export * from './react-client';
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
|
|
2
|
+
'use strict'
|
|
3
|
+
|
|
4
|
+
if (process.env.NODE_ENV === 'production') {
|
|
5
|
+
module.exports = require('./next-intl.cjs.production.min.js')
|
|
6
|
+
} else {
|
|
7
|
+
module.exports = require('./next-intl.cjs.development.js')
|
|
8
|
+
}
|
package/dist/link/Link.d.ts
CHANGED
|
@@ -1,30 +1,27 @@
|
|
|
1
|
-
import React, { ComponentProps } from 'react';
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
declare const _default: React.ForwardRefExoticComponent<Omit<Props, "ref"> & React.RefAttributes<HTMLAnchorElement>>;
|
|
29
|
-
|
|
30
|
-
export { _default as default };
|
|
1
|
+
import React, { ComponentProps } from 'react';
|
|
2
|
+
import BaseLink from '../shared/BaseLink';
|
|
3
|
+
type Props = Omit<ComponentProps<typeof BaseLink>, 'locale'> & {
|
|
4
|
+
locale?: string;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Wraps `next/link` and prefixes the `href` with the current locale if
|
|
8
|
+
* necessary.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```tsx
|
|
12
|
+
* import {Link} from 'next-intl';
|
|
13
|
+
*
|
|
14
|
+
* // When the user is on `/en`, the link will point to `/en/about`
|
|
15
|
+
* <Link href="/about">About</Link>
|
|
16
|
+
*
|
|
17
|
+
* // You can override the `locale` to switch to another language
|
|
18
|
+
* <Link href="/" locale="de">Switch to German</Link>
|
|
19
|
+
* ```
|
|
20
|
+
*
|
|
21
|
+
* Note that when a `locale` prop is passed to switch the locale, the `prefetch`
|
|
22
|
+
* prop is not supported. This is because Next.js would prefetch the page and
|
|
23
|
+
* the `set-cookie` response header would cause the locale cookie on the current
|
|
24
|
+
* page to be overwritten before the user even decides to change the locale.
|
|
25
|
+
*/
|
|
26
|
+
declare const _default: React.ForwardRefExoticComponent<Omit<Props, "ref"> & React.RefAttributes<HTMLAnchorElement>>;
|
|
27
|
+
export default _default;
|
package/dist/link/index.d.ts
CHANGED
|
@@ -1,29 +1,28 @@
|
|
|
1
|
-
type LocalePrefix = 'as-needed' | 'always';
|
|
2
|
-
type RoutingBaseConfig = {
|
|
3
|
-
/** A list of all locales that are supported. */
|
|
4
|
-
locales: Array<string>;
|
|
5
|
-
defaultLocale: string;
|
|
6
|
-
/** The default locale can be used without a prefix (e.g. `/about`). If you prefer to have a prefix for the default locale as well (e.g. `/en/about`), you can switch this option to `always`.
|
|
7
|
-
*/
|
|
8
|
-
localePrefix?: LocalePrefix;
|
|
9
|
-
};
|
|
10
|
-
type DomainConfig = Omit<RoutingBaseConfig, 'locales' | 'localePrefix'> & {
|
|
11
|
-
/** The domain name (e.g. "example.com", "www.example.com" or "fr.example.com"). Note that the `x-forwarded-host` or alternatively the `host` header will be used to determine the requested domain. */
|
|
12
|
-
domain: string;
|
|
13
|
-
locales?: RoutingBaseConfig['locales'];
|
|
14
|
-
};
|
|
15
|
-
type MiddlewareConfig = RoutingBaseConfig & {
|
|
16
|
-
/** Can be used to change the locale handling per domain. */
|
|
17
|
-
domains?: Array<DomainConfig>;
|
|
18
|
-
/** By setting this to `false`, the `accept-language` header will no longer be used for locale detection. */
|
|
19
|
-
localeDetection?: boolean;
|
|
20
|
-
/** 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 */
|
|
21
|
-
alternateLinks?: boolean;
|
|
22
|
-
};
|
|
23
|
-
type MiddlewareConfigWithDefaults = MiddlewareConfig & {
|
|
24
|
-
alternateLinks: boolean;
|
|
25
|
-
localePrefix: LocalePrefix;
|
|
26
|
-
localeDetection: boolean;
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
export { DomainConfig, MiddlewareConfigWithDefaults, MiddlewareConfig as default };
|
|
1
|
+
type LocalePrefix = 'as-needed' | 'always';
|
|
2
|
+
type RoutingBaseConfig = {
|
|
3
|
+
/** A list of all locales that are supported. */
|
|
4
|
+
locales: Array<string>;
|
|
5
|
+
defaultLocale: string;
|
|
6
|
+
/** The default locale can be used without a prefix (e.g. `/about`). If you prefer to have a prefix for the default locale as well (e.g. `/en/about`), you can switch this option to `always`.
|
|
7
|
+
*/
|
|
8
|
+
localePrefix?: LocalePrefix;
|
|
9
|
+
};
|
|
10
|
+
export type DomainConfig = Omit<RoutingBaseConfig, 'locales' | 'localePrefix'> & {
|
|
11
|
+
/** The domain name (e.g. "example.com", "www.example.com" or "fr.example.com"). Note that the `x-forwarded-host` or alternatively the `host` header will be used to determine the requested domain. */
|
|
12
|
+
domain: string;
|
|
13
|
+
locales?: RoutingBaseConfig['locales'];
|
|
14
|
+
};
|
|
15
|
+
type MiddlewareConfig = RoutingBaseConfig & {
|
|
16
|
+
/** Can be used to change the locale handling per domain. */
|
|
17
|
+
domains?: Array<DomainConfig>;
|
|
18
|
+
/** By setting this to `false`, the `accept-language` header will no longer be used for locale detection. */
|
|
19
|
+
localeDetection?: boolean;
|
|
20
|
+
/** 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 */
|
|
21
|
+
alternateLinks?: boolean;
|
|
22
|
+
};
|
|
23
|
+
export type MiddlewareConfigWithDefaults = MiddlewareConfig & {
|
|
24
|
+
alternateLinks: boolean;
|
|
25
|
+
localePrefix: LocalePrefix;
|
|
26
|
+
localeDetection: boolean;
|
|
27
|
+
};
|
|
28
|
+
export default MiddlewareConfig;
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
import { NextRequest } from 'next/server';
|
|
2
|
-
import { MiddlewareConfigWithDefaults } from './NextIntlMiddlewareConfig
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
declare function getAlternateLinksHeaderValue(config: MiddlewareConfigWithDefaults, request: NextRequest): string;
|
|
8
|
-
|
|
9
|
-
export { getAlternateLinksHeaderValue as default };
|
|
1
|
+
import { NextRequest } from 'next/server';
|
|
2
|
+
import { MiddlewareConfigWithDefaults } from './NextIntlMiddlewareConfig';
|
|
3
|
+
/**
|
|
4
|
+
* See https://developers.google.com/search/docs/specialty/international/localized-versions
|
|
5
|
+
*/
|
|
6
|
+
export default function getAlternateLinksHeaderValue(config: MiddlewareConfigWithDefaults, request: NextRequest): string;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
/**
|
|
2
|
+
* The middleware, available as `next-intl/middleware`.
|
|
3
|
+
*/
|
|
4
|
+
export { default } from './middleware';
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import { NextRequest, NextResponse } from 'next/server';
|
|
2
|
-
import MiddlewareConfig from './NextIntlMiddlewareConfig
|
|
3
|
-
|
|
4
|
-
declare function createMiddleware(config: MiddlewareConfig): (request: NextRequest) => NextResponse<unknown>;
|
|
5
|
-
|
|
6
|
-
export { createMiddleware as default };
|
|
1
|
+
import { NextRequest, NextResponse } from 'next/server';
|
|
2
|
+
import MiddlewareConfig from './NextIntlMiddlewareConfig';
|
|
3
|
+
export default function createMiddleware(config: MiddlewareConfig): (request: NextRequest) => NextResponse<unknown>;
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
import { RequestCookies } from 'next/dist/server/web/spec-extension/cookies';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
export { resolveLocale as default };
|
|
1
|
+
import { RequestCookies } from 'next/dist/server/web/spec-extension/cookies';
|
|
2
|
+
import { DomainConfig, MiddlewareConfigWithDefaults } from './NextIntlMiddlewareConfig';
|
|
3
|
+
export default function resolveLocale(config: MiddlewareConfigWithDefaults, requestHeaders: Headers, requestCookies: RequestCookies, pathname: string): {
|
|
4
|
+
locale: string;
|
|
5
|
+
domain?: DomainConfig;
|
|
6
|
+
};
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
import { DomainConfig } from './NextIntlMiddlewareConfig
|
|
2
|
-
|
|
3
|
-
declare function
|
|
4
|
-
declare function
|
|
5
|
-
declare function
|
|
6
|
-
declare function getBestMatchingDomain(curHostDomain: DomainConfig | undefined, locale: string, domainConfigs: Array<DomainConfig>): DomainConfig | undefined;
|
|
7
|
-
|
|
8
|
-
export { getBestMatchingDomain, getHost, getLocaleFromPathname, isLocaleSupportedOnDomain };
|
|
1
|
+
import { DomainConfig } from './NextIntlMiddlewareConfig';
|
|
2
|
+
export declare function getLocaleFromPathname(pathname: string): string;
|
|
3
|
+
export declare function getHost(requestHeaders: Headers): string | undefined;
|
|
4
|
+
export declare function isLocaleSupportedOnDomain(locale: string, domain: DomainConfig): boolean;
|
|
5
|
+
export declare function getBestMatchingDomain(curHostDomain: DomainConfig | undefined, locale: string, domainConfigs: Array<DomainConfig>): DomainConfig | undefined;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var useIntl = require('use-intl');
|
|
6
|
+
var router = require('next/router');
|
|
7
|
+
var React = require('react');
|
|
8
|
+
|
|
9
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
10
|
+
|
|
11
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
12
|
+
|
|
13
|
+
function _extends() {
|
|
14
|
+
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
15
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
16
|
+
var source = arguments[i];
|
|
17
|
+
for (var key in source) {
|
|
18
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
19
|
+
target[key] = source[key];
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
return target;
|
|
24
|
+
};
|
|
25
|
+
return _extends.apply(this, arguments);
|
|
26
|
+
}
|
|
27
|
+
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
28
|
+
if (source == null) return {};
|
|
29
|
+
var target = {};
|
|
30
|
+
var sourceKeys = Object.keys(source);
|
|
31
|
+
var key, i;
|
|
32
|
+
for (i = 0; i < sourceKeys.length; i++) {
|
|
33
|
+
key = sourceKeys[i];
|
|
34
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
35
|
+
target[key] = source[key];
|
|
36
|
+
}
|
|
37
|
+
return target;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
var _excluded = ["children", "locale", "now"];
|
|
41
|
+
function NextIntlClientProvider(_ref) {
|
|
42
|
+
var children = _ref.children,
|
|
43
|
+
locale = _ref.locale,
|
|
44
|
+
now = _ref.now,
|
|
45
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
46
|
+
var router$1;
|
|
47
|
+
try {
|
|
48
|
+
// Reading from context is practically ok to do conditionally
|
|
49
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
50
|
+
router$1 = router.useRouter();
|
|
51
|
+
} catch (error) {
|
|
52
|
+
// Calling `useRouter` is not supported in the app folder
|
|
53
|
+
}
|
|
54
|
+
// The router can be undefined if used in a context outside
|
|
55
|
+
// of Next.js (e.g. unit tests, Storybook, ...)
|
|
56
|
+
if (!locale && router$1) {
|
|
57
|
+
locale = router$1.locale;
|
|
58
|
+
}
|
|
59
|
+
// Currently RSC serialize dates to strings, therefore make sure we have
|
|
60
|
+
// a date object. We might be able to remove this once more types have
|
|
61
|
+
// first-class serialization support (https://github.com/facebook/react/issues/25687)
|
|
62
|
+
if (typeof now === 'string') {
|
|
63
|
+
now = new Date(now);
|
|
64
|
+
}
|
|
65
|
+
if (!locale) {
|
|
66
|
+
throw new Error("Couldn't determine locale. Please pass an explicit `locale` prop the provider, or if you're using the `pages` folder, use internationalized routing (https://nextjs.org/docs/advanced-features/i18n-routing)." );
|
|
67
|
+
}
|
|
68
|
+
return React__default["default"].createElement(useIntl.IntlProvider, _extends({
|
|
69
|
+
locale: locale,
|
|
70
|
+
now: now
|
|
71
|
+
}, rest), children);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
exports.NextIntlClientProvider = NextIntlClientProvider;
|
|
75
|
+
exports.NextIntlProvider = NextIntlClientProvider;
|
|
76
|
+
Object.keys(useIntl).forEach(function (k) {
|
|
77
|
+
if (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, {
|
|
78
|
+
enumerable: true,
|
|
79
|
+
get: function () { return useIntl[k]; }
|
|
80
|
+
});
|
|
81
|
+
});
|
|
82
|
+
//# sourceMappingURL=next-intl.cjs.development.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"next-intl.cjs.development.js","sources":["../src/shared/NextIntlClientProvider.tsx"],"sourcesContent":["'use client';\n\nimport {useRouter} from 'next/router';\nimport React, {ComponentProps} from 'react';\nimport {IntlProvider} from 'use-intl';\n\ntype Props = Omit<ComponentProps<typeof IntlProvider>, 'locale' | 'now'> & {\n locale?: string;\n /** If a string is supplied, make sure this conforms to the ISO 8601 format (YYYY-MM-DDTHH:mm:ss.sssZ */\n now?: Date | string;\n};\n\nexport default function NextIntlClientProvider({\n children,\n locale,\n now,\n ...rest\n}: Props) {\n let router;\n try {\n // Reading from context is practically ok to do conditionally\n // eslint-disable-next-line react-hooks/rules-of-hooks\n router = useRouter();\n } catch (error) {\n // Calling `useRouter` is not supported in the app folder\n }\n\n // The router can be undefined if used in a context outside\n // of Next.js (e.g. unit tests, Storybook, ...)\n if (!locale && router) {\n locale = router.locale;\n }\n\n // Currently RSC serialize dates to strings, therefore make sure we have\n // a date object. We might be able to remove this once more types have\n // first-class serialization support (https://github.com/facebook/react/issues/25687)\n if (typeof now === 'string') {\n now = new Date(now);\n }\n\n if (!locale) {\n throw new Error(\n process.env.NODE_ENV !== 'production'\n ? \"Couldn't determine locale. Please pass an explicit `locale` prop the provider, or if you're using the `pages` folder, use internationalized routing (https://nextjs.org/docs/advanced-features/i18n-routing).\"\n : undefined\n );\n }\n\n return (\n <IntlProvider locale={locale} now={now} {...rest}>\n {children}\n </IntlProvider>\n );\n}\n"],"names":["_excluded","NextIntlClientProvider","_ref","children","locale","now","rest","_objectWithoutPropertiesLoose","router","useRouter","error","Date","Error","React","createElement","IntlProvider","_extends"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAa,IAAAA,SAAA,GAAA,CAAA,UAAA,EAAA,QAAA,EAAA,KAAA,CAAA,CAAA;AAYW,SAAAC,sBAAsBA,CAAAC,IAAA,EAKtC;AAAA,EAAA,IAJNC,QAAQ,GAAAD,IAAA,CAARC,QAAQ;IACRC,MAAM,GAAAF,IAAA,CAANE,MAAM;IACNC,GAAG,GAAAH,IAAA,CAAHG,GAAG;AACAC,IAAAA,IAAI,GAAAC,6BAAA,CAAAL,IAAA,EAAAF,SAAA,CAAA,CAAA;AAEP,EAAA,IAAIQ,QAAM,CAAA;EACV,IAAI;AACF;AACA;IACAA,QAAM,GAAGC,gBAAS,EAAE,CAAA;GACrB,CAAC,OAAOC,KAAK,EAAE;AACd;AAAA,GAAA;AAGF;AACA;AACA,EAAA,IAAI,CAACN,MAAM,IAAII,QAAM,EAAE;IACrBJ,MAAM,GAAGI,QAAM,CAACJ,MAAM,CAAA;AACvB,GAAA;AAED;AACA;AACA;AACA,EAAA,IAAI,OAAOC,GAAG,KAAK,QAAQ,EAAE;AAC3BA,IAAAA,GAAG,GAAG,IAAIM,IAAI,CAACN,GAAG,CAAC,CAAA;AACpB,GAAA;EAED,IAAI,CAACD,MAAM,EAAE;AACX,IAAA,MAAM,IAAIQ,KAAK,CAET,+MAA+M,CACtM,CACd,CAAA;AACF,GAAA;AAED,EAAA,OACEC,yBAAC,CAAAC,aAAA,CAAAC,oBAAY,EAAAC,QAAA,CAAA;AAACZ,IAAAA,MAAM,EAAEA,MAAM;AAAEC,IAAAA,GAAG,EAAEA,GAAAA;GAASC,EAAAA,IAAI,CAC7CH,EAAAA,QAAQ,CACI,CAAA;AAEnB;;;;;;;;;;;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("use-intl"),r=require("next/router");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=t(require("react"));function o(){return o=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},o.apply(this,arguments)}var i=["children","locale","now"];function l(t){var l,u=t.children,a=t.locale,c=t.now,f=function(e,r){if(null==e)return{};var t,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r.indexOf(t=i[n])>=0||(o[t]=e[t]);return o}(t,i);try{l=r.useRouter()}catch(e){}if(!a&&l&&(a=l.locale),"string"==typeof c&&(c=new Date(c)),!a)throw new Error(void 0);return n.default.createElement(e.IntlProvider,o({locale:a,now:c},f),u)}exports.NextIntlClientProvider=l,exports.NextIntlProvider=l,Object.keys(e).forEach((function(r){"default"===r||exports.hasOwnProperty(r)||Object.defineProperty(exports,r,{enumerable:!0,get:function(){return e[r]}})}));
|
|
2
|
+
//# sourceMappingURL=next-intl.cjs.production.min.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"next-intl.cjs.production.min.js","sources":["../src/shared/NextIntlClientProvider.tsx"],"sourcesContent":["'use client';\n\nimport {useRouter} from 'next/router';\nimport React, {ComponentProps} from 'react';\nimport {IntlProvider} from 'use-intl';\n\ntype Props = Omit<ComponentProps<typeof IntlProvider>, 'locale' | 'now'> & {\n locale?: string;\n /** If a string is supplied, make sure this conforms to the ISO 8601 format (YYYY-MM-DDTHH:mm:ss.sssZ */\n now?: Date | string;\n};\n\nexport default function NextIntlClientProvider({\n children,\n locale,\n now,\n ...rest\n}: Props) {\n let router;\n try {\n // Reading from context is practically ok to do conditionally\n // eslint-disable-next-line react-hooks/rules-of-hooks\n router = useRouter();\n } catch (error) {\n // Calling `useRouter` is not supported in the app folder\n }\n\n // The router can be undefined if used in a context outside\n // of Next.js (e.g. unit tests, Storybook, ...)\n if (!locale && router) {\n locale = router.locale;\n }\n\n // Currently RSC serialize dates to strings, therefore make sure we have\n // a date object. We might be able to remove this once more types have\n // first-class serialization support (https://github.com/facebook/react/issues/25687)\n if (typeof now === 'string') {\n now = new Date(now);\n }\n\n if (!locale) {\n throw new Error(\n process.env.NODE_ENV !== 'production'\n ? \"Couldn't determine locale. Please pass an explicit `locale` prop the provider, or if you're using the `pages` folder, use internationalized routing (https://nextjs.org/docs/advanced-features/i18n-routing).\"\n : undefined\n );\n }\n\n return (\n <IntlProvider locale={locale} now={now} {...rest}>\n {children}\n </IntlProvider>\n );\n}\n"],"names":["_excluded","NextIntlClientProvider","_ref","router","children","locale","now","rest","_objectWithoutPropertiesLoose","useRouter","error","Date","Error","undefined","React","createElement","IntlProvider","_extends"],"mappings":"6bAAa,IAAAA,EAAA,CAAA,WAAA,SAAA,OAYW,SAAAC,EAAsBC,GAKtC,IACFC,EALJC,EAAQF,EAARE,SACAC,EAAMH,EAANG,OACAC,EAAGJ,EAAHI,IACGC,oIAAIC,CAAAN,EAAAF,GAGP,IAGEG,EAASM,EAASA,WACnB,CAAC,MAAOC,GACP,CAgBF,IAXKL,GAAUF,IACbE,EAASF,EAAOE,QAMC,iBAARC,IACTA,EAAM,IAAIK,KAAKL,KAGZD,EACH,MAAM,IAAIO,WAGJC,GAIR,OACEC,UAACC,cAAAC,EAAYA,aAAAC,EAAA,CAACZ,OAAQA,EAAQC,IAAKA,GAASC,GACzCH,EAGP"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export * from 'use-intl';
|
|
2
|
-
export { default as NextIntlClientProvider, default as NextIntlProvider } from './shared/
|
|
3
|
-
|
|
2
|
+
export { default as NextIntlClientProvider, default as NextIntlProvider } from './shared/next-intl.esm.js';
|
|
3
|
+
//# sourceMappingURL=next-intl.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"next-intl.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -1,3 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import '
|
|
1
|
+
/**
|
|
2
|
+
* This is the main entry file when non-'react-server'
|
|
3
|
+
* environments import from 'next-intl'.
|
|
4
|
+
*
|
|
5
|
+
* Maintainer notes:
|
|
6
|
+
* - Make sure this mirrors the API from 'react-server'.
|
|
7
|
+
* - Make sure everything exported from this module is
|
|
8
|
+
* supported in all Next.js versions that are supported.
|
|
9
|
+
*/
|
|
10
|
+
export * from 'use-intl';
|
|
11
|
+
export { default as NextIntlClientProvider } from '../shared/NextIntlClientProvider';
|
|
12
|
+
export { default as NextIntlProvider } from '../shared/NextIntlClientProvider';
|
|
@@ -1,23 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import '
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
*
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
declare
|
|
15
|
-
declare const
|
|
16
|
-
declare const
|
|
17
|
-
declare const
|
|
18
|
-
declare const useLocale: typeof notSupported;
|
|
19
|
-
declare const useNow: typeof notSupported;
|
|
20
|
-
declare const useTimeZone: typeof notSupported;
|
|
21
|
-
declare const Link: typeof notSupported;
|
|
22
|
-
|
|
23
|
-
export { IntlProvider, Link, useIntl, useLocale, useNow, useTimeZone, useTranslations };
|
|
1
|
+
/**
|
|
2
|
+
* This is the main entry file when 'react-server' environments
|
|
3
|
+
* (i.e. RSC) import from 'next-intl'. Currently we export everything
|
|
4
|
+
* from `use-intl` core, but React-APIs are stubbed out.
|
|
5
|
+
*
|
|
6
|
+
* Make sure this mirrors the API from '../react-client'.
|
|
7
|
+
*/
|
|
8
|
+
export * from 'use-intl/dist/src/core';
|
|
9
|
+
export { default as NextIntlClientProvider } from '../shared/NextIntlClientProvider';
|
|
10
|
+
declare function notSupported(): void;
|
|
11
|
+
export declare const IntlProvider: typeof notSupported;
|
|
12
|
+
export declare const useTranslations: typeof notSupported;
|
|
13
|
+
export declare const useIntl: typeof notSupported;
|
|
14
|
+
export declare const useLocale: typeof notSupported;
|
|
15
|
+
export declare const useNow: typeof notSupported;
|
|
16
|
+
export declare const useTimeZone: typeof notSupported;
|
|
17
|
+
export declare const Link: typeof notSupported;
|
package/dist/server/index.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export { createIntlMiddleware };
|
|
1
|
+
/**
|
|
2
|
+
* Server-only APIs available via `next-intl/server`.
|
|
3
|
+
*/
|
|
4
|
+
import MiddlewareConfig from '../middleware/NextIntlMiddlewareConfig';
|
|
5
|
+
/** @deprecated Should be imported as `import createMiddleware from 'next-intl/middleware', not from `next-intl/server`. */
|
|
6
|
+
export declare function createIntlMiddleware(config: MiddlewareConfig): (request: import("next/server").NextRequest) => import("next/server").NextResponse<unknown>;
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import NextLink from 'next/link';
|
|
2
|
-
import React, { ComponentProps } from 'react';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
export { _default as default };
|
|
1
|
+
import NextLink from 'next/link';
|
|
2
|
+
import React, { ComponentProps } from 'react';
|
|
3
|
+
type Props = Omit<ComponentProps<typeof NextLink>, 'locale'> & {
|
|
4
|
+
locale: string;
|
|
5
|
+
};
|
|
6
|
+
declare const _default: React.ForwardRefExoticComponent<Omit<Props, "ref"> & React.RefAttributes<HTMLAnchorElement>>;
|
|
7
|
+
export default _default;
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import { ComponentProps } from 'react';
|
|
2
|
-
import { IntlProvider } from 'use-intl';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
export { NextIntlClientProvider as default };
|
|
1
|
+
import { ComponentProps } from 'react';
|
|
2
|
+
import { IntlProvider } from 'use-intl';
|
|
3
|
+
type Props = Omit<ComponentProps<typeof IntlProvider>, 'locale' | 'now'> & {
|
|
4
|
+
locale?: string;
|
|
5
|
+
/** If a string is supplied, make sure this conforms to the ISO 8601 format (YYYY-MM-DDTHH:mm:ss.sssZ */
|
|
6
|
+
now?: Date | string;
|
|
7
|
+
};
|
|
8
|
+
export default function NextIntlClientProvider({ children, locale, now, ...rest }: Props): JSX.Element;
|
|
9
|
+
export {};
|