Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion docs/h3/functions/getCookieLocale.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

[@intlify/utils](../../index.md) / [h3](../index.md) / getCookieLocale

# Function: getCookieLocale()
# ~~Function: getCookieLocale()~~

```ts
function getCookieLocale(event, options): Locale;
Expand Down Expand Up @@ -43,3 +43,7 @@ app.use(eventHandler(event) => {
## Throws

Throws a `RangeError` if `lang` option or cookie name value are not a well-formed BCP 47 language tag.

## Deprecated

since v2. Use `getCookieLocale` of `@intlify/utils` instead.
6 changes: 5 additions & 1 deletion docs/h3/functions/getHeaderLanguage.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

[@intlify/utils](../../index.md) / [h3](../index.md) / getHeaderLanguage

# Function: getHeaderLanguage()
# ~~Function: getHeaderLanguage()~~

```ts
function getHeaderLanguage(event, options): string;
Expand Down Expand Up @@ -44,3 +44,7 @@ app.use(eventHandler(event) => {
return `accepted language: ${langTag}`
})
```

## Deprecated

since v2. Use `getHeaderLanguage` of `@intlify/utils` instead.
6 changes: 5 additions & 1 deletion docs/h3/functions/getHeaderLanguages.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

[@intlify/utils](../../index.md) / [h3](../index.md) / getHeaderLanguages

# Function: getHeaderLanguages()
# ~~Function: getHeaderLanguages()~~

```ts
function getHeaderLanguages(event, options): string[];
Expand Down Expand Up @@ -44,3 +44,7 @@ app.use(eventHandler(event) => {
return `accepted languages: ${acceptLanguages.join(', ')}`
})
```

## Deprecated

since v2. Use `getHeaderLanguages` of `@intlify/utils` instead.
6 changes: 5 additions & 1 deletion docs/h3/functions/getHeaderLocale.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

[@intlify/utils](../../index.md) / [h3](../index.md) / getHeaderLocale

# Function: getHeaderLocale()
# ~~Function: getHeaderLocale()~~

```ts
function getHeaderLocale(event, options): Locale;
Expand Down Expand Up @@ -47,3 +47,7 @@ app.use(eventHandler(event) => {
## Throws

Throws the `RangeError` if `lang` option or header are not a well-formed BCP 47 language tag.

## Deprecated

since v2. Use `getHeaderLocale` of `@intlify/utils` instead.
6 changes: 5 additions & 1 deletion docs/h3/functions/getHeaderLocales.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

[@intlify/utils](../../index.md) / [h3](../index.md) / getHeaderLocales

# Function: getHeaderLocales()
# ~~Function: getHeaderLocales()~~

```ts
function getHeaderLocales(event, options): Locale[];
Expand Down Expand Up @@ -47,3 +47,7 @@ app.use(eventHandler(event) => {
## Throws

Throws the `RangeError` if header are not a well-formed BCP 47 language tag.

## Deprecated

since v2. Use `getHeaderLocales` of `@intlify/utils` instead.
6 changes: 5 additions & 1 deletion docs/h3/functions/getPathLocale.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

[@intlify/utils](../../index.md) / [h3](../index.md) / getPathLocale

# Function: getPathLocale()
# ~~Function: getPathLocale()~~

```ts
function getPathLocale(event, options): Locale;
Expand All @@ -28,3 +28,7 @@ The locale that resolved from path
## Throws

Throws the `RangeError` if the language in the path, that is not a well-formed BCP 47 language tag.

## Deprecated

since v2. Use `getPathLocale` of `@intlify/utils` instead.
6 changes: 5 additions & 1 deletion docs/h3/functions/getQueryLocale.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

[@intlify/utils](../../index.md) / [h3](../index.md) / getQueryLocale

# Function: getQueryLocale()
# ~~Function: getQueryLocale()~~

```ts
function getQueryLocale(event, options): Locale;
Expand All @@ -28,3 +28,7 @@ The locale that resolved from query
## Throws

Throws the `RangeError` if the language in the query, that is not a well-formed BCP 47 language tag.

## Deprecated

since v2. Use `getQueryLocale` of `@intlify/utils` instead.
6 changes: 5 additions & 1 deletion docs/h3/functions/setCookieLocale.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

[@intlify/utils](../../index.md) / [h3](../index.md) / setCookieLocale

# Function: setCookieLocale()
# ~~Function: setCookieLocale()~~

```ts
function setCookieLocale(
Expand Down Expand Up @@ -44,3 +44,7 @@ app.use(eventHandler(event) => {
## Throws

Throws the `SyntaxError` if `locale` is invalid.

## Deprecated

since v2. Use `setCookieLocale` of `@intlify/utils` instead.
6 changes: 5 additions & 1 deletion docs/h3/functions/tryCookieLocale.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

[@intlify/utils](../../index.md) / [h3](../index.md) / tryCookieLocale

# Function: tryCookieLocale()
# ~~Function: tryCookieLocale()~~

```ts
function tryCookieLocale(event, options): Locale | null;
Expand All @@ -28,3 +28,7 @@ The locale that resolved from cookie. if `lang` option or cookie name value are
## Description

Unlike [`getCookieLocale`](getCookieLocale.md), this function does not throw an error if the locale cannot be obtained, this function returns `null`.

## Deprecated

since v2. Use `tryCookieLocale` of `@intlify/utils` instead.
6 changes: 5 additions & 1 deletion docs/h3/functions/tryHeaderLocale.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

[@intlify/utils](../../index.md) / [h3](../index.md) / tryHeaderLocale

# Function: tryHeaderLocale()
# ~~Function: tryHeaderLocale()~~

```ts
function tryHeaderLocale(event, options): Locale | null;
Expand All @@ -28,3 +28,7 @@ The first locale that resolved from header string. if you use `accept-language`
## Description

wrap language tag with Intl.Locale \| locale, languages tags will be parsed from `accept-language` header as default. Unlike [getHeaderLocale](getHeaderLocale.md), this function does not throw an error if the locale cannot be obtained, this function returns `null`.

## Deprecated

since v2. Use `tryHeaderLocale` of `@intlify/utils` instead.
6 changes: 5 additions & 1 deletion docs/h3/functions/tryHeaderLocales.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

[@intlify/utils](../../index.md) / [h3](../index.md) / tryHeaderLocales

# Function: tryHeaderLocales()
# ~~Function: tryHeaderLocales()~~

```ts
function tryHeaderLocales(event, options): Locale[] | null;
Expand All @@ -28,3 +28,7 @@ The locales that wrapped from header, if you use `accept-language` header and `*
## Description

wrap language tags with Intl.Locale \| locale, languages tags will be parsed from `accept-language` header as default. Unlike [getHeaderLocales](getHeaderLocales.md), this function does not throw an error if the locale cannot be obtained, this function returns `null`.

## Deprecated

since v2. Use `tryHeaderLocales` of `@intlify/utils` instead.
6 changes: 5 additions & 1 deletion docs/h3/functions/tryPathLocale.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

[@intlify/utils](../../index.md) / [h3](../index.md) / tryPathLocale

# Function: tryPathLocale()
# ~~Function: tryPathLocale()~~

```ts
function tryPathLocale(event, options): Locale | null;
Expand All @@ -28,3 +28,7 @@ The locale that resolved from path. if the language in the path, that is not a w
## Description

Unlike [`getPathLocale`](getPathLocale.md), this function does not throw an error if the locale cannot be obtained, this function returns `null`.

## Deprecated

since v2. Use `tryPathLocale` of `@intlify/utils` instead.
6 changes: 5 additions & 1 deletion docs/h3/functions/tryQueryLocale.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

[@intlify/utils](../../index.md) / [h3](../index.md) / tryQueryLocale

# Function: tryQueryLocale()
# ~~Function: tryQueryLocale()~~

```ts
function tryQueryLocale(event, options): Locale | null;
Expand All @@ -28,3 +28,7 @@ The locale that resolved from query. if the language in the query, that is not a
## Description

Unlike [`getQueryLocale`](getQueryLocale.md), this function does not throw an error if the locale cannot be obtained, this function returns `null`.

## Deprecated

since v2. Use `tryQueryLocale` of `@intlify/utils` instead.
26 changes: 13 additions & 13 deletions docs/h3/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@ import { getHeaderLocale } from '@intlify/utils/h3'

| Function | Description |
| ------ | ------ |
| [getCookieLocale](functions/getCookieLocale.md) | get locale from cookie |
| [getHeaderLanguage](functions/getHeaderLanguage.md) | get language from header |
| [getHeaderLanguages](functions/getHeaderLanguages.md) | get languages from header |
| [getHeaderLocale](functions/getHeaderLocale.md) | get locale from header |
| [getHeaderLocales](functions/getHeaderLocales.md) | get locales from header |
| [getPathLocale](functions/getPathLocale.md) | get the locale from the path |
| [getQueryLocale](functions/getQueryLocale.md) | get the locale from the query |
| [setCookieLocale](functions/setCookieLocale.md) | set locale to the response `Set-Cookie` header. |
| [tryCookieLocale](functions/tryCookieLocale.md) | try to get locale from cookie |
| [tryHeaderLocale](functions/tryHeaderLocale.md) | try to get locale from header |
| [tryHeaderLocales](functions/tryHeaderLocales.md) | try to get locales from header |
| [tryPathLocale](functions/tryPathLocale.md) | try to get the locale from the path |
| [tryQueryLocale](functions/tryQueryLocale.md) | try to get the locale from the query |
| [~~getCookieLocale~~](functions/getCookieLocale.md) | get locale from cookie |
| [~~getHeaderLanguage~~](functions/getHeaderLanguage.md) | get language from header |
| [~~getHeaderLanguages~~](functions/getHeaderLanguages.md) | get languages from header |
| [~~getHeaderLocale~~](functions/getHeaderLocale.md) | get locale from header |
| [~~getHeaderLocales~~](functions/getHeaderLocales.md) | get locales from header |
| [~~getPathLocale~~](functions/getPathLocale.md) | get the locale from the path |
| [~~getQueryLocale~~](functions/getQueryLocale.md) | get the locale from the query |
| [~~setCookieLocale~~](functions/setCookieLocale.md) | set locale to the response `Set-Cookie` header. |
| [~~tryCookieLocale~~](functions/tryCookieLocale.md) | try to get locale from cookie |
| [~~tryHeaderLocale~~](functions/tryHeaderLocale.md) | try to get locale from header |
| [~~tryHeaderLocales~~](functions/tryHeaderLocales.md) | try to get locales from header |
| [~~tryPathLocale~~](functions/tryPathLocale.md) | try to get the locale from the path |
| [~~tryQueryLocale~~](functions/tryQueryLocale.md) | try to get the locale from the query |
6 changes: 5 additions & 1 deletion docs/hono/functions/getCookieLocale.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

[@intlify/utils](../../index.md) / [hono](../index.md) / getCookieLocale

# Function: getCookieLocale()
# ~~Function: getCookieLocale()~~

```ts
function getCookieLocale(context, options): Locale;
Expand Down Expand Up @@ -44,3 +44,7 @@ app.use('/', c => {
## Throws

Throws a `RangeError` if `lang` option or cookie name value are not a well-formed BCP 47 language tag.

## Deprecated

since v2. Use `getCookieLocale` of `@intlify/utils` instead.
6 changes: 5 additions & 1 deletion docs/hono/functions/getHeaderLanguage.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

[@intlify/utils](../../index.md) / [hono](../index.md) / getHeaderLanguage

# Function: getHeaderLanguage()
# ~~Function: getHeaderLanguage()~~

```ts
function getHeaderLanguage(context, options): string;
Expand Down Expand Up @@ -44,3 +44,7 @@ app.use('/', c => {
return c.text(`accepted language: ${langTag}`)
})
```

## Deprecated

since v2. Use `getHeaderLanguage` of `@intlify/utils` instead.
6 changes: 5 additions & 1 deletion docs/hono/functions/getHeaderLanguages.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

[@intlify/utils](../../index.md) / [hono](../index.md) / getHeaderLanguages

# Function: getHeaderLanguages()
# ~~Function: getHeaderLanguages()~~

```ts
function getHeaderLanguages(context, options): string[];
Expand Down Expand Up @@ -44,3 +44,7 @@ app.use('/', c => {
return c.text(`accepted languages: ${acceptLanguages.join(', ')}`)
})
```

## Deprecated

since v2. Use `getHeaderLanguages` of `@intlify/utils` instead.
6 changes: 5 additions & 1 deletion docs/hono/functions/getHeaderLocale.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

[@intlify/utils](../../index.md) / [hono](../index.md) / getHeaderLocale

# Function: getHeaderLocale()
# ~~Function: getHeaderLocale()~~

```ts
function getHeaderLocale(context, options): Locale;
Expand Down Expand Up @@ -48,3 +48,7 @@ app.use('/', c => {
## Throws

Throws the `RangeError` if `lang` option or header are not a well-formed BCP 47 language tag.

## Deprecated

since v2. Use `getHeaderLocale` of `@intlify/utils` instead.
6 changes: 5 additions & 1 deletion docs/hono/functions/getHeaderLocales.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

[@intlify/utils](../../index.md) / [hono](../index.md) / getHeaderLocales

# Function: getHeaderLocales()
# ~~Function: getHeaderLocales()~~

```ts
function getHeaderLocales(context, options): Locale[];
Expand Down Expand Up @@ -48,3 +48,7 @@ app.use('/', c => {
## Throws

Throws the `RangeError` if header are not a well-formed BCP 47 language tag.

## Deprecated

since v2. Use `getHeaderLocales` of `@intlify/utils` instead.
6 changes: 5 additions & 1 deletion docs/hono/functions/getPathLocale.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

[@intlify/utils](../../index.md) / [hono](../index.md) / getPathLocale

# Function: getPathLocale()
# ~~Function: getPathLocale()~~

```ts
function getPathLocale(context, options): Locale;
Expand All @@ -28,3 +28,7 @@ The locale that resolved from path
## Throws

Throws the `RangeError` if the language in the path, that is not a well-formed BCP 47 language tag.

## Deprecated

since v2. Use `getPathLocale` of `@intlify/utils` instead.
6 changes: 5 additions & 1 deletion docs/hono/functions/getQueryLocale.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

[@intlify/utils](../../index.md) / [hono](../index.md) / getQueryLocale

# Function: getQueryLocale()
# ~~Function: getQueryLocale()~~

```ts
function getQueryLocale(context, options): Locale;
Expand All @@ -28,3 +28,7 @@ The locale that resolved from query
## Throws

Throws the `RangeError` if the language in the query, that is not a well-formed BCP 47 language tag.

## Deprecated

since v2. Use `getQueryLocale` of `@intlify/utils` instead.
6 changes: 5 additions & 1 deletion docs/hono/functions/setCookieLocale.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

[@intlify/utils](../../index.md) / [hono](../index.md) / setCookieLocale

# Function: setCookieLocale()
# ~~Function: setCookieLocale()~~

```ts
function setCookieLocale(
Expand Down Expand Up @@ -45,3 +45,7 @@ app.use('/', c => {
## Throws

Throws the `SyntaxError` if `locale` is invalid.

## Deprecated

since v2. Use `setCookieLocale` of `@intlify/utils` instead.
Loading
Loading