Skip to content

Commit

Permalink
Prepare for localization support zotero#82
Browse files Browse the repository at this point in the history
* Add react-intl
* Automate message extraction & compilation into AST
* In devel, defaultMessage from the source code is used. In production
  that is removed and instead AST-compiled messages are used (which in
  future can be easilly used for localisation)
  • Loading branch information
tnajdek committed Aug 20, 2021
1 parent 79e8b5b commit 882c886
Show file tree
Hide file tree
Showing 6 changed files with 1,500 additions and 49 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -5,6 +5,7 @@ lib
.DS_Store
build
data
lang
config/local*.json
.npmrc
.nyc_output
6 changes: 4 additions & 2 deletions babel.config.cjs
Expand Up @@ -16,8 +16,10 @@ const plugins = [
"corejs": 3,
"helpers": true,
"regenerator": false,
}]

}],
["formatjs", { removeDefaultMessage: !!process.env.NODE_ENV?.startsWith('prod') }]
];



module.exports = { presets, plugins };

0 comments on commit 882c886

Please sign in to comment.