File tree Expand file tree Collapse file tree 4 files changed +8
-4
lines changed Expand file tree Collapse file tree 4 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -125,7 +125,8 @@ number_of_contributions_in_the_last_12_months = %s contributions in the last 12
125
125
no_contributions = No contributions
126
126
less = Less
127
127
more = More
128
- number_of_contributions_on_date = <b>%[1]s contributions</b> on %[2]s
128
+ number_of_contributions_on_date_n = <b>%[2]s contributions</b> on %[1]s
129
+ number_of_contributions_on_date_1 = <b>1 contribution</b> on %[1]s
129
130
130
131
[editor]
131
132
buttons.heading.tooltip = Add heading
Original file line number Diff line number Diff line change 5
5
data-locale-no-contributions="{{.locale.Tr "heatmap.no_contributions"}}"
6
6
data-locale-more="{{.locale.Tr "heatmap.more"}}"
7
7
data-locale-less="{{.locale.Tr "heatmap.less"}}"
8
- data-locale-contributions-on="{{.locale.Tr "heatmap.number_of_contributions_on_date"}}"
8
+ data-locale-contributions-on-n="{{.locale.Tr "heatmap.number_of_contributions_on_date_n"}}"
9
+ data-locale-contributions-on-1="{{.locale.Tr "heatmap.number_of_contributions_on_date_1"}}"
9
10
>
10
11
<div slot="loading">
11
12
<div class="ui active centered inline indeterminate text loader" id="loading-heatmap">{{.locale.Tr "user.heatmap.loading"}}</div>
Original file line number Diff line number Diff line change @@ -70,7 +70,8 @@ export default {
70
70
const datetime = v .date .toISOString ();
71
71
const fallback = v .date .toLocaleDateString ();
72
72
const date = ` <relative-time format="datetime" year="numeric" month="short" day="numeric" weekday="" datetime="${ datetime} ">${ fallback} </relative-time>` ;
73
- return locale .contributions_on .replace (' %[1]s' , number).replace (' %[2]s' , date);
73
+ const stringToFormat = v .count === 1 ? locale .contributions_on_1 : locale .contributions_on_n ;
74
+ return stringToFormat .replace (' %[2]s' , number).replace (' %[1]s' , date);
74
75
}
75
76
},
76
77
};
Original file line number Diff line number Diff line change @@ -25,7 +25,8 @@ export function initHeatmap() {
25
25
no_contributions : el . getAttribute ( 'data-locale-no-contributions' ) ,
26
26
more : el . getAttribute ( 'data-locale-more' ) ,
27
27
less : el . getAttribute ( 'data-locale-less' ) ,
28
- contributions_on : el . getAttribute ( 'data-locale-contributions-on' ) ,
28
+ contributions_on_n : el . getAttribute ( 'data-locale-contributions-on-n' ) ,
29
+ contributions_on_1 : el . getAttribute ( 'data-locale-contributions-on-1' ) ,
29
30
} ;
30
31
31
32
const View = createApp ( ActivityHeatmap , { values, locale} ) ;
You can’t perform that action at this time.
0 commit comments