Skip to content
This repository was archived by the owner on Jan 10, 2024. It is now read-only.

Commit f752442

Browse files
author
Eugene Manuilov
committed
Updated documentation
1 parent 7f4f6d4 commit f752442

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,8 @@ After doing it you can start using `gettext`, `ngettext`, `xgettext` and `nxgett
100100
+ };
101101
```
102102

103+
See an [example](https://github.com/eugene-manuilov/react-gettext/tree/master/examples) application to get better understanding how to use it.
104+
103105
## Documentation
104106

105107
### withGettext(translations, pluralForms)
@@ -158,6 +160,8 @@ const HOC = withGettext()(App);
158160
ReactDOM.render(<HOC translations={getTranslations} plural={getPluralForms}>...</HOC>, ...);
159161
```
160162

163+
One more alternative is to not create HOC, but use Textdomain component directly. You can import it using `import { Textdomain } from 'react-gettext'` and use it as a regular component which will provide context functions to translate your messages. Just don't forget to pass `translations` and `plural` props to this component when you render it.
164+
161165

162166
### gettext(message)
163167

0 commit comments

Comments
 (0)