fix(ui,i18n): move plural check to i18next (#58560)

This commit is contained in:
Raymond Liu
2025-02-04 00:21:09 -08:00
committed by GitHub
parent 9c0659e501
commit 683b6cfcad
2 changed files with 3 additions and 12 deletions

View File

@@ -366,8 +366,8 @@
"joined": "Joined {{date}}",
"from": "From {{location}}",
"total-points": "Total Points:",
"points-singular": "{{count}} point on {{date}}",
"points-plural": "{{count}} points on {{date}}",
"points_one": "{{count}} point on {{date}}",
"points_other": "{{count}} points on {{date}}",
"page-number": "{{pageNumber}} of {{totalPages}}",
"edit-my-profile": "Edit My Profile",
"add-bluesky": "Share this certification on BlueSky",

View File

@@ -128,17 +128,8 @@ class HeatMapInner extends Component<HeatMapInnerProps, HeatMapInnerState> {
if (!value || value.count < 0) {
return { 'data-tip': '' };
}
// Use singular translation if count == 1 else plural
if (value.count === 1) {
return {
'data-tip': t('profile.points-singular', {
count: value.count,
date: dateFormatted
})
};
}
return {
'data-tip': t('profile.points-plural', {
'data-tip': t('profile.points', {
count: value.count,
date: dateFormatted
})