Skip to content

Commit

Permalink
Add translations filter to the sentence on NRC country overview
Browse files Browse the repository at this point in the history
  • Loading branch information
Bluesmile82 committed Sep 23, 2022
1 parent a8af2aa commit e1e2811
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,13 @@ const getCountryName = createSelector([
return countryNames[countryData.NAME_0] || countryData.NAME_0;
});

const getDescription = createSelector(getCountryData, (countryData) => {
if (!countryData) return null;
return countryData.sentence;
});
const getDescription = createSelector(
[getCountryData, selectLangUrlState],
(countryData, locale) => {
if (!countryData) return null;
return locale && locale !== 'en' ? countryData[`sentence_${locale}`] : countryData.sentence;
},
);

const getHasPriority = createSelector(getCountryData, (countryData) => {
if (!countryData) return null;
Expand Down

1 comment on commit e1e2811

@vercel
Copy link

@vercel vercel bot commented on e1e2811 Sep 26, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.