Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
cheton committed Jun 9, 2018
1 parent 31c9e59 commit fbf686e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ module.exports = {
trans: {
component: 'Trans',
i18nKey: 'i18nKey',
defaultsKey: 'defaults',
extensions: ['.js', '.jsx'],
fallbackKey: function(ns, value) {
// Returns a hash value as the fallback key
Expand Down Expand Up @@ -185,7 +186,7 @@ parser
content = fs.readFileSync('/path/to/app.jsx', 'utf-8');
parser
.parseTransFromString(content, customHandler) // pass a custom handler
.parseTransFromString(content, { component: 'Trans', i18nKey: 'i18nKey' })
.parseTransFromString(content, { component: 'Trans', i18nKey: 'i18nKey', defaultsKey: 'defaults' })
.parseTransFromString(content, { fallbackKey: true }) // Uses defaultValue as the fallback key when the i18nKey attribute is missing
.parseTransFromString(content); // use default options and handler

Expand Down Expand Up @@ -494,6 +495,7 @@ Below are the configuration options with their default values:
trans: {
component: 'Trans',
i18nKey: 'i18nKey',
defaultsKey: 'defaults',
extensions: ['.js', '.jsx'],
fallbackKey: false
},
Expand Down Expand Up @@ -589,6 +591,7 @@ If an `Object` is supplied, you can specify a list of extensions, or override th
trans: {
component: 'Trans',
i18nKey: 'i18nKey',
defaultsKey: 'defaults',
extensions: ['.js', '.jsx'],
fallbackKey: false
}
Expand Down

0 comments on commit fbf686e

Please sign in to comment.