text-localizer
Advanced tools
Comparing version 0.1.1 to 0.1.2
{ | ||
"name": "text-localizer", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"main": "lib/index.js", | ||
@@ -22,2 +22,3 @@ "types": "lib/index.d.ts", | ||
"git": { | ||
"commitMessage": "chore: release text-localizer ${version}", | ||
"tagName": "text-localizer/${version}" | ||
@@ -24,0 +25,0 @@ }, |
@@ -5,2 +5,39 @@ <h1 align="center"> | ||
[**Tutorial can be found here.**](https://enzomanuelmangano.github.io/text-localizer/docs/basic-tutorial/js-ts/setup) | ||
## Tutorial | ||
[**Tutorial can be found here**](https://enzomanuelmangano.github.io/text-localizer/docs/basic-tutorial/js-ts/setup). | ||
## Usage | ||
```ts | ||
import { TextLocalizer } from 'text-localizer'; | ||
import { fetchItTranslations } from './l10n/it'; | ||
(async () => { | ||
const localizer = new TextLocalizer({ | ||
us: import('./l10n/us.json'), | ||
uk: import('./l10n/uk'), | ||
it: fetchItTranslations, | ||
}); | ||
await localizer.setOptions({ | ||
language: 'uk', | ||
}); | ||
const translations = localizer.translations; | ||
console.log(translations.question); // "Which is your favourite cat?" | ||
console.log( | ||
localizer.formatTranslation(translations.help, { topic: 'Text Localizer' }) | ||
); | ||
})(); | ||
``` | ||
## Contributing | ||
See the [contributing guide](https://github.com/enzomanuelmangano/text-localizer/blob/main/CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow. | ||
## License | ||
MIT |
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
30328
43