feat(i18n): 增强生理周期模块的国际化支持,添加多语言格式和翻译
This commit is contained in:
@@ -17,6 +17,7 @@ interface MonthBlockProps {
|
||||
selectedDateKey: string;
|
||||
onSelect: (dateKey: string) => void;
|
||||
renderTip: (colIndex: number) => React.ReactNode;
|
||||
weekLabels?: string[];
|
||||
}
|
||||
|
||||
export const MonthBlock: React.FC<MonthBlockProps> = ({
|
||||
@@ -24,8 +25,10 @@ export const MonthBlock: React.FC<MonthBlockProps> = ({
|
||||
selectedDateKey,
|
||||
onSelect,
|
||||
renderTip,
|
||||
weekLabels,
|
||||
}) => {
|
||||
const weeks = useMemo(() => chunkArray(month.cells, 7), [month.cells]);
|
||||
const labels = weekLabels?.length === 7 ? weekLabels : WEEK_LABELS;
|
||||
|
||||
return (
|
||||
<View style={styles.monthCard}>
|
||||
@@ -34,7 +37,7 @@ export const MonthBlock: React.FC<MonthBlockProps> = ({
|
||||
<Text style={styles.monthSubtitle}>{month.subtitle}</Text>
|
||||
</View>
|
||||
<View style={styles.weekRow}>
|
||||
{WEEK_LABELS.map((label) => (
|
||||
{labels.map((label) => (
|
||||
<Text key={label} style={styles.weekLabel}>
|
||||
{label}
|
||||
</Text>
|
||||
|
||||
Reference in New Issue
Block a user