Skip to content

Commit

Permalink
Merge pull request #44 from bento-platform/bug-fixes-1
Browse files Browse the repository at this point in the history
Fixed translation issues
  • Loading branch information
brouillette authored Nov 21, 2022
2 parents f277bf3 + 3f90dac commit 3837f74
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/js/components/Overview/charts/BentoPie.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,9 @@ function BentoPie({ data, height }) {

// Changing immutable data to mutable data
data = [...data];
// remove "missing" field if zero

data = data.filter((e) => !(e.x === 'missing'));
data = data.map((d) => ({ ...d, x: t(d.x) }));

// combining sections with less than OTHER_THRESHOLD
const sum = data.reduce((acc, e) => acc + e.y, 0);
Expand Down Expand Up @@ -120,7 +121,7 @@ function BentoPie({ data, height }) {
<path d={`M${sx},${sy}L${mx},${my}L${ex},${ey}`} stroke={fill} fill="none" />
<circle cx={ex} cy={ey} r={2} fill={fill} stroke="none" />
<text x={ex + (cos >= 0 ? 1 : -1) * 12} y={ey + 3} textAnchor={textAnchor} style={currentTextStyle}>
{labelShortName(t(name))}
{labelShortName(name)}
</text>
<text x={ex + (cos >= 0 ? 1 : -1) * 12} y={ey} dy={14} textAnchor={textAnchor} style={countTextStyle}>
{`(${t(payload.value)})`}
Expand Down
2 changes: 1 addition & 1 deletion src/js/components/Search/SearchResults.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const SearchResults = () => {
<Space direction="vertical" size="middle" style={{ display: 'flex' }}>
<Statistic
title={t('Individuals')}
value={isValid ? (status === 'count' ? count : message) : '----'}
value={isValid ? (status === 'count' ? count : t(message)) : '----'}
valueStyle={{ color: '#1890ff' }}
prefix={<TeamOutlined />}
/>
Expand Down
3 changes: 2 additions & 1 deletion src/public/locales/en/default_translation_en.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,6 @@
"Authors": "Authors",
"Dates": "Dates",
"Description": "Description",
"Manage Charts": "Manage Charts"
"Manage Charts": "Manage Charts",
"Insufficient data available.": "Insufficient data available."
}

0 comments on commit 3837f74

Please sign in to comment.