- No certifications have been earned under the current curriculum
-
+
-
Legacy Certifications
+
{t('settings.headings.legacy-certs')}
{legacyCerts.map(renderCertShowWithUsername)}
diff --git a/client/src/components/profile/components/HeatMap.js b/client/src/components/profile/components/HeatMap.js
index 6d356d527a..ebd1716577 100644
--- a/client/src/components/profile/components/HeatMap.js
+++ b/client/src/components/profile/components/HeatMap.js
@@ -7,6 +7,7 @@ import addDays from 'date-fns/addDays';
import addMonths from 'date-fns/addMonths';
import startOfDay from 'date-fns/startOfDay';
import isEqual from 'date-fns/isEqual';
+import { useTranslation } from 'react-i18next';
import FullWidthRow from '../../helpers/FullWidthRow';
import Spacer from '../../helpers/Spacer';
@@ -14,6 +15,11 @@ import Spacer from '../../helpers/Spacer';
import '@freecodecamp/react-calendar-heatmap/dist/styles.css';
import './heatmap.css';
+import { langCodes } from '../../../../i18n/allLangs';
+import { clientLocale } from '../../../../config/env';
+
+const localeCode = langCodes[clientLocale];
+
const propTypes = {
calendar: PropTypes.object
};
@@ -23,7 +29,8 @@ const innerPropTypes = {
currentStreak: PropTypes.number,
longestStreak: PropTypes.number,
pages: PropTypes.array,
- points: PropTypes.number
+ points: PropTypes.number,
+ t: PropTypes.func.isRequired
};
class HeatMapInner extends Component {
@@ -57,12 +64,12 @@ class HeatMapInner extends Component {
}
render() {
- const { calendarData, currentStreak, longestStreak, pages } = this.props;
+ const { calendarData, currentStreak, longestStreak, pages, t } = this.props;
const { startOfCalendar, endOfCalendar } = pages[this.state.pageIndex];
- const title = `${startOfCalendar.toLocaleDateString('en-US', {
+ const title = `${startOfCalendar.toLocaleDateString([localeCode, 'en-US'], {
year: 'numeric',
month: 'short'
- })} - ${endOfCalendar.toLocaleDateString('en-US', {
+ })} - ${endOfCalendar.toLocaleDateString([localeCode, 'en-US'], {
year: 'numeric',
month: 'short'
})}`;
@@ -108,24 +115,22 @@ class HeatMapInner extends Component {
endDate={endOfCalendar}
startDate={startOfCalendar}
tooltipDataAttrs={value => {
- let valueCount;
- if (value && value.count === 1) {
- valueCount = '1 point';
- } else if (value && value.count > 1) {
- valueCount = `${value.count} points`;
- } else {
- valueCount = 'No points';
- }
- const dateFormatted = value.date
- ? 'on ' +
- value.date.toLocaleDateString('en-US', {
- year: 'numeric',
- month: 'short',
- day: 'numeric'
- })
- : '';
+ const dateFormatted =
+ value && value.date
+ ? value.date.toLocaleDateString([localeCode, 'en-US'], {
+ year: 'numeric',
+ month: 'short',
+ day: 'numeric'
+ })
+ : '';
return {
- 'data-tip': `
${valueCount} ${dateFormatted}`
+ 'data-tip':
+ value && value.count > -1
+ ? t('profile.points', {
+ count: value.count,
+ date: dateFormatted
+ })
+ : ''
};
}}
values={dataToDisplay}
@@ -136,10 +141,10 @@ class HeatMapInner extends Component {
- Longest Streak: {longestStreak || 0}
+ {t('profile.longest-streak')} {longestStreak || 0}
- Current Streak: {currentStreak || 0}
+ {t('profile.current-streak')} {currentStreak || 0}
@@ -152,6 +157,7 @@ class HeatMapInner extends Component {
HeatMapInner.propTypes = innerPropTypes;
const HeatMap = props => {
+ const { t } = useTranslation();
const { calendar } = props;
/**
@@ -244,6 +250,7 @@ const HeatMap = props => {
currentStreak={currentStreak}
longestStreak={longestStreak}
pages={pages}
+ t={t}
/>
);
};
diff --git a/client/src/components/profile/components/HeatMap.test.js b/client/src/components/profile/components/HeatMap.test.js
index dede4c9008..bd31f55a25 100644
--- a/client/src/components/profile/components/HeatMap.test.js
+++ b/client/src/components/profile/components/HeatMap.test.js
@@ -44,14 +44,14 @@ describe('
', () => {
it('calculates the correct longest streak', () => {
const { getByTestId } = render(
);
expect(getByTestId('longest-streak').textContent).toContain(
- 'Longest Streak: 2'
+ 'profile.longest-streak'
);
});
it('calculates the correct current streak', () => {
const { getByTestId } = render(
);
expect(getByTestId('current-streak').textContent).toContain(
- 'Current Streak: 1'
+ 'profile.current-streak'
);
});
});
diff --git a/client/src/components/profile/components/Portfolio.js b/client/src/components/profile/components/Portfolio.js
index e85a6d6c7d..4b371ca29b 100644
--- a/client/src/components/profile/components/Portfolio.js
+++ b/client/src/components/profile/components/Portfolio.js
@@ -1,6 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';
import { Media } from '@freecodecamp/react-bootstrap';
+import { useTranslation } from 'react-i18next';
import { FullWidthRow } from '../../helpers';
@@ -19,18 +20,19 @@ const propTypes = {
};
function Portfolio({ portfolio = [] }) {
+ const { t } = useTranslation();
if (!portfolio.length) {
return null;
}
return (
- Portfolio
+ {t('profile.portfolio')}
{portfolio.map(({ title, url, image, description, id }) => (
{image && (
diff --git a/client/src/components/profile/components/SocialIcons.js b/client/src/components/profile/components/SocialIcons.js
index c79588698a..a250d5ab5d 100644
--- a/client/src/components/profile/components/SocialIcons.js
+++ b/client/src/components/profile/components/SocialIcons.js
@@ -8,7 +8,7 @@ import {
faTwitter
} from '@fortawesome/free-brands-svg-icons';
import { faLink } from '@fortawesome/free-solid-svg-icons';
-
+import { useTranslation } from 'react-i18next';
import './social-icons.css';
const propTypes = {
@@ -26,9 +26,10 @@ const propTypes = {
};
function LinkedInIcon(linkedIn, username) {
+ const { t } = useTranslation();
return (
this.viewSolution(id, solution, files)}
>
- Show Code
+ {t('buttons.show-code')}
);
} else if (githubLink) {
@@ -119,7 +126,7 @@ class TimelineInner extends Component {
rel='noopener noreferrer'
target='_blank'
>
- Front End
+ {t('buttons.frontend')}
@@ -143,7 +150,7 @@ class TimelineInner extends Component {
rel='noopener noreferrer'
target='_blank'
>
- View
+ {t('buttons.view')}
);
} else {
@@ -175,7 +182,11 @@ class TimelineInner extends Component {