From fbf686ef29e081574e73fb370a1765d85cfcdb7b Mon Sep 17 00:00:00 2001 From: Cheton Wu Date: Sat, 9 Jun 2018 08:26:51 +0800 Subject: [PATCH] Update README.md --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 29065f1..31bd8de 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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 @@ -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 }, @@ -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 }