Commit 0df24208 authored by imrishabh18's avatar imrishabh18 Committed by Jose Vargas

Address translation of months in ci_minutes component

parent 1ded4b19
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
import { GlDropdown, GlDropdownItem } from '@gitlab/ui'; import { GlDropdown, GlDropdownItem } from '@gitlab/ui';
import { GlColumnChart } from '@gitlab/ui/dist/charts'; import { GlColumnChart } from '@gitlab/ui/dist/charts';
import { keyBy } from 'lodash'; import { keyBy } from 'lodash';
import { __ } from '~/locale';
import { import {
USAGE_BY_PROJECT, USAGE_BY_PROJECT,
X_AXIS_PROJECT_LABEL, X_AXIS_PROJECT_LABEL,
...@@ -14,6 +15,20 @@ export default { ...@@ -14,6 +15,20 @@ export default {
X_AXIS_PROJECT_LABEL, X_AXIS_PROJECT_LABEL,
X_AXIS_CATEGORY, X_AXIS_CATEGORY,
Y_AXIS_LABEL, Y_AXIS_LABEL,
i18n: {
january: __('January'),
february: __('February'),
march: __('March'),
april: __('April'),
may: __('May'),
june: __('June'),
july: __('July'),
august: __('August'),
september: __('September'),
october: __('October'),
november: __('November'),
december: __('December'),
},
components: { components: {
GlColumnChart, GlColumnChart,
GlDropdown, GlDropdown,
...@@ -71,6 +86,9 @@ export default { ...@@ -71,6 +86,9 @@ export default {
setFirstMonthDropdown() { setFirstMonthDropdown() {
[this.selectedMonth] = this.months; [this.selectedMonth] = this.months;
}, },
getTranslatedMonthName(month) {
return this.$options.i18n[month.toLowerCase()] ?? month;
},
}, },
}; };
</script> </script>
...@@ -87,7 +105,7 @@ export default { ...@@ -87,7 +105,7 @@ export default {
data-testid="month-dropdown-item" data-testid="month-dropdown-item"
@click="changeSelectedMonth(monthName)" @click="changeSelectedMonth(monthName)"
> >
{{ monthName }} {{ getTranslatedMonthName(monthName) }}
</gl-dropdown-item> </gl-dropdown-item>
</gl-dropdown> </gl-dropdown>
</div> </div>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment