File tree Expand file tree Collapse file tree 3 files changed +13
-6
lines changed
Expand file tree Collapse file tree 3 files changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -281,6 +281,7 @@ const Header = ({siteTitle}) => {
281281| siteUrl | string | public site url, is used to generate language specific meta tags |
282282| pages | array | an array of [ page options] ( #page-options ) used to modify plugin behaviour for specific pages |
283283| i18nextOptions | object | [ i18next configuration options] ( https://www.i18next.com/overview/configuration-options ) |
284+ | verbose | boolean | Verbose output. Default is true |
284285
285286## Page options
286287
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ export const onCreateNode = async (
1616 reporter
1717 } : // @ts -ignore
1818 CreateNodeArgs < FileSystemNode > ,
19- { localeJsonSourceName = 'locale' } : PluginOptions
19+ { localeJsonSourceName = 'locale' , verbose = true } : PluginOptions
2020) => {
2121 if ( ! unstable_shouldOnCreateNode ( { node} ) ) {
2222 return ;
@@ -45,10 +45,13 @@ export const onCreateNode = async (
4545 return ;
4646 }
4747
48- const activity = reporter . activityTimer (
49- `gatsby-plugin-react-i18next: create node: ${ relativeDirectory } /${ name } `
50- ) ;
51- activity . start ( ) ;
48+ let activity ;
49+ if ( verbose ) {
50+ activity = reporter . activityTimer (
51+ `gatsby-plugin-react-i18next: create node: ${ relativeDirectory } /${ name } `
52+ ) ;
53+ activity . start ( ) ;
54+ }
5255
5356 // relativeDirectory name is language name.
5457 const language = relativeDirectory ;
@@ -86,5 +89,7 @@ export const onCreateNode = async (
8689 // staled issue: https://github.com/gatsbyjs/gatsby/issues/19993
8790 createParentChildLink ( { parent : node , child : localeNode } ) ;
8891
89- activity . end ( ) ;
92+ if ( verbose && activity ) {
93+ activity . end ( ) ;
94+ }
9095} ;
Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ export type PluginOptions = {
2323 localeJsonSourceName ?: string ;
2424 localeJsonNodeName ?: string ;
2525 fallbackLanguage ?: string ;
26+ verbose ?: boolean ;
2627} ;
2728
2829export type I18NextContext = {
You can’t perform that action at this time.
0 commit comments