@vocab/react
Advanced tools
Comparing version 0.0.9 to 0.0.10
# @vocab/react | ||
## 0.0.10 | ||
### Patch Changes | ||
- Updated dependencies [[`283bcad`](https://github.com/seek-oss/vocab/commit/283bcada06e622ab14ed891743ed3f55cf09e245), [`f3992ef`](https://github.com/seek-oss/vocab/commit/f3992efbf08939ebf853fac650a49cc46dc51dfb)]: | ||
- @vocab/types@0.0.7 | ||
## 0.0.9 | ||
@@ -4,0 +11,0 @@ |
{ | ||
"name": "@vocab/react", | ||
"version": "0.0.9", | ||
"version": "0.0.10", | ||
"main": "dist/vocab-react.cjs.js", | ||
@@ -12,3 +12,3 @@ "module": "dist/vocab-react.esm.js", | ||
"dependencies": { | ||
"@vocab/types": "^0.0.6", | ||
"@vocab/types": "^0.0.7", | ||
"intl-messageformat": "^9.3.18" | ||
@@ -15,0 +15,0 @@ }, |
@@ -71,5 +71,5 @@ # Vocab | ||
**Note:** Currently, to create a new translation it must be placed inside a **`__translations__`** folder, this folder name can be configured with `translationsDirname` configuration. | ||
**Note:** Currently, to create a new translation it must be placed inside a folder ending in **`.vocab`**, this folder suffix can be configured with the `translationsDirectorySuffix` configuration value. | ||
**`./__translations__/translations.json`** | ||
**`./example.vocab/translations.json`** | ||
@@ -86,3 +86,3 @@ ```json | ||
Then run `vocab compile`. Or `vocab compile --watch`. | ||
This will create new `translation.ts` files for each `translation.json` file. | ||
This will create a new `index.ts` file for each folder ending in **`.vocab`**. | ||
@@ -95,3 +95,3 @@ You can then import these translations into your React components. Translations can be used by calling the `t` function returned by `useTranslation`. | ||
import { useTranslation } from '@vocab/react'; | ||
import translations from './translations'; | ||
import translations from './example.vocab'; | ||
@@ -106,5 +106,5 @@ function MyComponent({ children }) { | ||
So far your app will run, but you're missing any translations other than the initial language. The below file can be created manually; however, you can also integrate with a remote translation platform to push and pull translations automatically. | ||
So far your app will run, but you're missing any translations other than the initial language. The below file can be created manually; however, you can also integrate with a remote translation platform to push and pull translations automatically. See [Externeral translation tooling](#external-translation-tooling) for more information. | ||
**./\_\_translations\_\_/translations.fr-FR.json** | ||
**./example.vocab/fr-FR.translations.json** | ||
@@ -156,3 +156,17 @@ ```json | ||
{ name: 'fr-FR' } | ||
] | ||
], | ||
/** | ||
* The root directory to compile and validate translations | ||
* Default: Current working directory | ||
*/ | ||
projectRoot: ['./example/']; | ||
/** | ||
* A custom suffix to name vocab translation directories | ||
* Default: '.vocab' | ||
*/ | ||
translationsDirectorySuffix: '.vocab', | ||
/** | ||
* An array of glob paths to ignore from compilation and validation | ||
*/ | ||
ignore: ['**/ignored_directory/**'] | ||
}; | ||
@@ -163,5 +177,5 @@ ``` | ||
Vocab generates custom `translation.ts` files that give your React components strongly typed translations to work with. | ||
Vocab generates custom `index.ts` files that give your React components strongly typed translations to work with. | ||
To generate these types run: | ||
To generate these files run: | ||
@@ -172,3 +186,3 @@ ```bash | ||
Or to rerun the compiler when files change use: | ||
Or to re-run the compiler when files change use: | ||
@@ -175,0 +189,0 @@ ```bash |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
20090
202
+ Added@vocab/types@0.0.7(transitive)
- Removed@vocab/types@0.0.6(transitive)
Updated@vocab/types@^0.0.7