Skip to content

Commit

Permalink
fix(studio): add content notice translations
Browse files Browse the repository at this point in the history
  • Loading branch information
rob-gordon committed Dec 7, 2021
1 parent c6636be commit 96e4611
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import { Callout, Intent } from '@blueprintjs/core'
import { lang } from 'botpress/shared'
import React, { useContext } from 'react'
import { connect } from 'react-redux'
import { RootReducer } from '~/reducers'
import { FlowReducer } from '~/reducers/flows'
import { WidgetContext } from '../Content/Select/WidgetContext'
import { getContentItemUsage } from '../Shared/Utils'
import withLanguage from '../Util/withLanguage'

import style from './style.scss'

/** Displays a warning to user if cms content used in multiple places */
Expand All @@ -15,8 +18,13 @@ export function ContentNotice({ flows, qnaUsage }: { flows: FlowReducer; qnaUsag
return null
}
return (
<Callout className={style.contentNotice} title="Changing Shared Content" intent={Intent.PRIMARY} icon="info-sign">
<p>This content is used in {usage.length} places. Changing it will affect all places.</p>
<Callout
className={style.contentNotice}
title={lang.tr('contentNotice.title')}
intent={Intent.PRIMARY}
icon="info-sign"
>
<p>{lang.tr('contentNotice.message', { count: usage.length })}</p>
</Callout>
)
}
Expand All @@ -25,4 +33,4 @@ const mapStateToProps = (state: RootReducer) => ({
flows: state.flows,
qnaUsage: state.content.qnaUsage
})
export default connect(mapStateToProps)(ContentNotice)
export default connect(mapStateToProps)(withLanguage(ContentNotice))
4 changes: 4 additions & 0 deletions packages/ui-shared/src/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -281,5 +281,9 @@
"thisMonth": "This Month",
"thisWeek": "This Week",
"thisYear": "This Year"
},
"contentNotice": {
"title": "Changing Shared Content",
"message": "This content is used in {count} places. Changing it will affect all places."
}
}
4 changes: 4 additions & 0 deletions packages/ui-shared/src/translations/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -281,5 +281,9 @@
"thisMonth": "Este Mes",
"thisWeek": "Esta Semana",
"thisYear": "Este Año"
},
"contentNotice": {
"title": "Cambio de contenido compartido",
"message": "Este contenido se utiliza en {count} lugares. Cambiarlo afectará a todos los lugares."
}
}
4 changes: 4 additions & 0 deletions packages/ui-shared/src/translations/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -281,5 +281,9 @@
"thisMonth": "Ce mois-ci",
"thisWeek": "Cette semaine",
"thisYear": "Cette année"
},
"contentNotice": {
"title": "Modification du contenu partagé",
"message": "Ce contenu est utilisé à {count} endroits. Le changer affectera tous les endroits."
}
}

0 comments on commit 96e4611

Please sign in to comment.