Skip to content

Commit

Permalink
feat: support try APIs (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
kazupon committed Dec 6, 2023
1 parent 416286a commit 10146fb
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 11 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -297,16 +297,21 @@ The advantage of this way is that it is not necessary to specify the resource sc
- `getHeaderLocale(event, options)`: get locale from `accept-language` header
- `getHeaderLocales(event, options)`: get some locales from `accept-language` header
- `tryHeaderLocale(event, options)`: try to get locale from `accept-language` header
- `tryHeaderLocales(event, options)`: try to get some locales from `accept-language` header
### Cookies
- `getCookieLocale(event, options)`: get locale from cookie
- `tryCookieLocale(event, options)`: try to get locale from cookie
- `setCookieLocale(event, options)`: set locale to cookie
### Misc
- `getPathLocale(event, options)`: get locale from path
- `tryPathLocale(event, options)`: try to get locale from path
- `getQueryLocale(event, options)`: get locale from query
- `tryQueryLocale(event, options)`: try to get locale from query
## Helpers
Expand Down
Binary file modified bun.lockb
Binary file not shown.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,6 @@
},
"dependencies": {
"@intlify/core": "^9.8.0",
"@intlify/utils": "^0.11.1"
"@intlify/utils": "^0.12.0"
}
}
11 changes: 1 addition & 10 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,7 @@
import { createCoreContext, NOT_REOSLVED, translate as _translate } from '@intlify/core'
import { getHeaderLocale } from '@intlify/utils/h3'

export {
getCookieLocale,
getHeaderLanguage,
getHeaderLanguages,
getHeaderLocale,
getHeaderLocales,
getPathLocale,
getQueryLocale,
setCookieLocale,
} from '@intlify/utils/h3'
export * from '@intlify/utils/h3'

export type { CoreContext } from '@intlify/core'

Expand Down

0 comments on commit 10146fb

Please sign in to comment.