kotori 3.0.1 → 3.0.3

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.
Files changed (2) hide show
  1. package/README.md +3 -3
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -162,7 +162,7 @@ export const Page2 = () => {
162
162
 
163
163
  ![how kotori works](image.webp)
164
164
 
165
- ### `kotori(options)`
165
+ ### `kotori({ primaryLanguageTag: BCP47LanguageTag, secondaryLanguageTags: BCP47LanguageTag[] })`
166
166
 
167
167
  Creates a scoped i18n instance.
168
168
 
@@ -182,7 +182,7 @@ export const { useT, dict, setLanguage } = kotori({
182
182
 
183
183
  Returns `{ dict, useT, setLanguage }`.
184
184
 
185
- ### `dict(translations)<argsType?>`
185
+ ### `dict(Record<primaryLanguageTag | secondaryLanguageTags, string>)<argsType?>`
186
186
 
187
187
  Defines a translation unit. Takes one string per language.
188
188
 
@@ -211,7 +211,7 @@ React hook. Returns `{ t, language, setLanguage }`.
211
211
  | --- | --- | --- |
212
212
  | `t(dict, args?)` | `string` | Returns the translated string for the current language. `args` is required if the string has variables, omitted if it doesn't. |
213
213
  | `language` | `primaryLanguageTag` \| `secondaryLanguageTags` | The current language tag as a reactive value. Updates when `setLanguage` is called. |
214
- | `setLanguage(tag)` | `void` | Updates the language and rerenders all active `useT` consumers. |
214
+ | `setLanguage(primaryLanguageTag \| secondaryLanguageTags)` | `void` | Updates the language and rerenders all active `useT` consumers. |
215
215
 
216
216
  ## Language Tags
217
217
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "kotori",
3
3
  "description": "Strongly-typed and composable internationalization library for React",
4
- "version": "3.0.1",
4
+ "version": "3.0.3",
5
5
  "scripts": {
6
6
  "setup": "rm -rf node_modules && npm i && git init && husky",
7
7
  "prepublishOnly": "npm i && npx tsc && npm run build",