Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/streamich/use-t
🗺 Translations with React hooks
https://github.com/streamich/use-t
Last synced: 6 days ago
JSON representation
🗺 Translations with React hooks
- Host: GitHub
- URL: https://github.com/streamich/use-t
- Owner: streamich
- License: unlicense
- Created: 2018-11-06T14:59:28.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2024-10-07T02:49:30.000Z (28 days ago)
- Last Synced: 2024-10-23T12:40:15.949Z (11 days ago)
- Language: TypeScript
- Homepage:
- Size: 706 KB
- Stars: 44
- Watchers: 2
- Forks: 2
- Open Issues: 34
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
- fucking-awesome-react-hooks - `use-t` - language using hooks. (Packages)
- awesome-react-hooks-cn - `use-t` - language using hooks. (Packages)
- awesome-react-hooks - `use-t` - language using hooks. (Packages)
- awesome-react-hooks - `use-t` - language using hooks. (Packages)
README
🗺
use-t
Translations for React.
Installation
Reference
```js
import {Provider, useT, withT, Trans, Consumer, context} from 'use-t';
```- [``](./docs/Provider.md)
- [`useT()`](./docs/useT.md)
- [`withT()`](./docs/withT.md)
- [``](./docs/Trans.md)
- [``](./docs/Consumer.md)
- [`context`](./docs/context.md)
- [`createTranslations()`](./docs/createTranslations.md)
Example
```jsx
import {Provider, useT} from 'use-t';const Hello = (props) => {
const [t] = useT();
return (
{t('Hello')}, {props.name}!
{t.t('hello_user')`Hello, ${props.name}!`}
);
};`Hi, ${name}!`
}
}
}}>
```
License
Unlicense — public domain.