feat: Update week day representation and add localization support for weekdays
This commit is contained in:
@@ -78,7 +78,7 @@ const STRATEGIES: StrategyOption[] = [
|
|||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
const WEEK_DAYS = ['S', 'M', 'T', 'W', 'T', 'F', 'S'];
|
const WEEK_DAY_INDEXES = [0, 1, 2, 3, 4, 5, 6];
|
||||||
|
|
||||||
// Color Theme Variables for Mapping Editors
|
// Color Theme Variables for Mapping Editors
|
||||||
const MAPPING_THEME = {
|
const MAPPING_THEME = {
|
||||||
@@ -818,12 +818,12 @@ const StrategySelector: React.FC<StrategySelectorProps> = ({
|
|||||||
|
|
||||||
{/* Middle Row: Full Width Capsules */}
|
{/* Middle Row: Full Width Capsules */}
|
||||||
<div className={`grid grid-cols-7 w-full transition-opacity duration-200 mb-3 ${localSchedule.mode !== ScheduleMode.WEEKLY ? 'opacity-50 pointer-events-none' : ''}`}>
|
<div className={`grid grid-cols-7 w-full transition-opacity duration-200 mb-3 ${localSchedule.mode !== ScheduleMode.WEEKLY ? 'opacity-50 pointer-events-none' : ''}`}>
|
||||||
{WEEK_DAYS.map((day, index) => {
|
{WEEK_DAY_INDEXES.map((dayIndex) => {
|
||||||
const isSelected = localSchedule.weeklyDays.includes(index);
|
const isSelected = localSchedule.weeklyDays.includes(dayIndex);
|
||||||
return (
|
return (
|
||||||
<button
|
<button
|
||||||
key={index}
|
key={dayIndex}
|
||||||
onClick={() => toggleWeekDay(index)}
|
onClick={() => toggleWeekDay(dayIndex)}
|
||||||
className={`h-9 text-xs font-bold border-y border-l last:border-r border-gray-600/50 transition-colors
|
className={`h-9 text-xs font-bold border-y border-l last:border-r border-gray-600/50 transition-colors
|
||||||
first:rounded-l-lg last:rounded-r-lg
|
first:rounded-l-lg last:rounded-r-lg
|
||||||
${isSelected
|
${isSelected
|
||||||
@@ -832,7 +832,7 @@ const StrategySelector: React.FC<StrategySelectorProps> = ({
|
|||||||
}
|
}
|
||||||
`}
|
`}
|
||||||
>
|
>
|
||||||
{day}
|
{t(`schedule.weekdaysNarrow.${dayIndex}`)}
|
||||||
</button>
|
</button>
|
||||||
)
|
)
|
||||||
})}
|
})}
|
||||||
|
|||||||
@@ -100,6 +100,15 @@ export const en = {
|
|||||||
cron: 'Cron',
|
cron: 'Cron',
|
||||||
daily: 'Daily',
|
daily: 'Daily',
|
||||||
weekly: 'Weekly',
|
weekly: 'Weekly',
|
||||||
|
weekdaysNarrow: {
|
||||||
|
0: 'S',
|
||||||
|
1: 'M',
|
||||||
|
2: 'T',
|
||||||
|
3: 'W',
|
||||||
|
4: 'T',
|
||||||
|
5: 'F',
|
||||||
|
6: 'S',
|
||||||
|
},
|
||||||
enableCron: 'Enable Cron Schedule',
|
enableCron: 'Enable Cron Schedule',
|
||||||
enableDaily: 'Enable Daily Run',
|
enableDaily: 'Enable Daily Run',
|
||||||
enableWeekly: 'Enable Weekly Run',
|
enableWeekly: 'Enable Weekly Run',
|
||||||
|
|||||||
@@ -100,6 +100,15 @@ export const es = {
|
|||||||
cron: 'Cron',
|
cron: 'Cron',
|
||||||
daily: 'Diario',
|
daily: 'Diario',
|
||||||
weekly: 'Semanal',
|
weekly: 'Semanal',
|
||||||
|
weekdaysNarrow: {
|
||||||
|
0: 'D',
|
||||||
|
1: 'L',
|
||||||
|
2: 'M',
|
||||||
|
3: 'X',
|
||||||
|
4: 'J',
|
||||||
|
5: 'V',
|
||||||
|
6: 'S',
|
||||||
|
},
|
||||||
enableCron: 'Habilitar Cron',
|
enableCron: 'Habilitar Cron',
|
||||||
enableDaily: 'Habilitar Ejecución Diaria',
|
enableDaily: 'Habilitar Ejecución Diaria',
|
||||||
enableWeekly: 'Habilitar Ejecución Semanal',
|
enableWeekly: 'Habilitar Ejecución Semanal',
|
||||||
|
|||||||
@@ -100,6 +100,15 @@ export const zh = {
|
|||||||
cron: 'Cron',
|
cron: 'Cron',
|
||||||
daily: '每日',
|
daily: '每日',
|
||||||
weekly: '每周',
|
weekly: '每周',
|
||||||
|
weekdaysNarrow: {
|
||||||
|
0: '日',
|
||||||
|
1: '一',
|
||||||
|
2: '二',
|
||||||
|
3: '三',
|
||||||
|
4: '四',
|
||||||
|
5: '五',
|
||||||
|
6: '六',
|
||||||
|
},
|
||||||
enableCron: '启用 Cron 计划',
|
enableCron: '启用 Cron 计划',
|
||||||
enableDaily: '启用每日运行',
|
enableDaily: '启用每日运行',
|
||||||
enableWeekly: '启用每周运行',
|
enableWeekly: '启用每周运行',
|
||||||
|
|||||||
Reference in New Issue
Block a user