Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: update header text on the public profile sdg section. #2345

Merged
merged 2 commits into from
Jan 9, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion public/static/locales/en/profile.json
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@
"m2": "m²"
},
"infoAndCtaContainer": {
"sdgCardsSectionHeading": "Restoring Ecosystems & Fighting the Climate Crisis for the SDGs",
"sdgSectionHeadingPrimary": "Restoring Ecosystems & Fighting the Climate Crisis.",
"sdgSectionHeadingSecondary": "Contributing to the Sustainable Development Goals.",
"pfpDonorCircleMember": "Plant-for-the-Planet donor circle member",
"publicProfileActions": {
"becomeAMember": "Become a Member",
Expand Down
10 changes: 7 additions & 3 deletions src/features/common/CarouselSlider/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ const CarouselArrow = (props: {
};

interface CarouselSliderProps {
carouselTitle: string;
carouselTitles: {
primary: string;
secondary: string;
};
carouselData: ReactElement[];
settings: Settings;
currentSlide: number;
Expand All @@ -47,7 +50,7 @@ interface CarouselSliderProps {
}

const CarouselSlider = ({
carouselTitle,
carouselTitles,
carouselData,
settings,
currentSlide,
Expand Down Expand Up @@ -105,7 +108,8 @@ const CarouselSlider = ({
<div className={styles.carouselSliderContainer}>
<div className={styles.carouselHeader}>
<div className={styles.titleContainer}>
<h2>{carouselTitle}</h2>
<h2>{carouselTitles.primary}</h2>
<h2>{carouselTitles.secondary}</h2>
</div>
<div className={styles.arrowContainer}>
<CarouselArrow
Expand Down
5 changes: 4 additions & 1 deletion src/features/user/Profile/InfoAndCTA/SDGCardList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,10 @@ const SDGCardList = () => {
return (
<CarouselSlider
carouselData={sdgCardsDataArray}
carouselTitle={t('infoAndCtaContainer.sdgCardsSectionHeading')}
carouselTitles={{
primary: t('infoAndCtaContainer.sdgSectionHeadingPrimary'),
secondary: t('infoAndCtaContainer.sdgSectionHeadingSecondary'),
}}
Comment on lines +109 to +112
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Codebase verification

Translation key sdgSectionHeadingSecondary is missing in German locale

The English translation file has both required keys defined:

  • infoAndCtaContainer.sdgSectionHeadingPrimary
  • infoAndCtaContainer.sdgSectionHeadingSecondary

However, in the German translation file:

  • infoAndCtaContainer.sdgSectionHeadingPrimary is missing
  • infoAndCtaContainer.sdgSectionHeadingSecondary is missing
  • Instead, there's an older key infoAndCtaContainer.sdgCardsSectionHeading which seems to be outdated

Please add the following translations to the German locale file (public/static/locales/de/profile.json):

"sdgSectionHeadingPrimary": "Wiederherstellung von Ökosystemen & Bekämpfung der Klimakrise.",
"sdgSectionHeadingSecondary": "Beitrag zu den Zielen für nachhaltige Entwicklung."
🔗 Analysis chain

Ensure translation keys are defined and tested

These lines correctly introduce separate primary and secondary titles, improving clarity for the SDG section. However, please verify that both translation keys (infoAndCtaContainer.sdgSectionHeadingPrimary and infoAndCtaContainer.sdgSectionHeadingSecondary) are defined and correctly translated in all relevant language files so that you avoid runtime or UI text issues.

Below is a shell script to search for these translation keys in the repository’s translation files:


Let me try a different search strategy to locate the translation files and their content.


Let me try one more search strategy to locate the translation files, as they might be in a different location or format.


Let me check the content of the translation files we found to verify if these keys are defined.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# This script searches translation files for the new SDG section heading keys.
fd "\.json" | xargs rg "infoAndCtaContainer\.sdgSectionHeadingPrimary"
fd "\.json" | xargs rg "infoAndCtaContainer\.sdgSectionHeadingSecondary"

Length of output: 147


Script:

#!/bin/bash
# First, let's find all translation-related JSON files
fd -e json "translation|locale|i18n|lang"

# Then, let's try to find the parent key "infoAndCtaContainer" which might help us verify if we're looking in the right place
fd -e json "translation|locale|i18n|lang" | xargs rg "infoAndCtaContainer"

# Also search for any SDG-related translations to understand the structure
fd -e json "translation|locale|i18n|lang" | xargs rg "sdg" -i

Length of output: 253


Script:

#!/bin/bash
# Let's find all JSON files in the repository and check their content
fd -e json | xargs rg "infoAndCtaContainer" -l

# Also search for translation-related directories
fd -t d "translations|locales|i18n|lang"

# Let's also check for any TypeScript files that might import or define these translations
rg "infoAndCtaContainer" -t ts -A 2 -B 2

Length of output: 9104


Script:

#!/bin/bash
# Check the content of the English and German translation files for these specific keys
echo "=== English translations ==="
cat "public/static/locales/en/profile.json"

echo -e "\n=== German translations ==="
cat "public/static/locales/de/profile.json"

Length of output: 13453

settings={settings}
currentSlide={currentSlide}
setCurrentSlide={setCurrentSlide}
Expand Down
Loading