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

Commit e9e8391

Browse files
author
Eugene Manuilov
committed
Added example for xgettext function
1 parent d9d2bb0 commit e9e8391

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,13 @@ The function to translate a string based on a specific context. Accepts a messag
164164
- **message**: A string to be translated.
165165
- **context**: A context to search translation in.
166166

167+
Example:
168+
169+
```javascript
170+
// somewhere in your jsx component
171+
this.context.xgettext('some text', 'context where this message is used');
172+
```
173+
167174
## Poedit
168175

169176
If you use Poedit app to translate your messages, then you can use `gettext;ngettext:1,2;xgettext:1,2c` as keywords list to properly parse and extract strings from your javascript files.

0 commit comments

Comments
 (0)