feat(i18n): 增强生理周期模块的国际化支持,添加多语言格式和翻译
This commit is contained in:
@@ -1,19 +1,21 @@
|
||||
import React from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { StyleSheet, Text, View } from 'react-native';
|
||||
import { STATUS_COLORS } from './constants';
|
||||
import { LegendItem } from './types';
|
||||
|
||||
const LEGEND_ITEMS: LegendItem[] = [
|
||||
{ label: '经期', key: 'period' },
|
||||
{ label: '预测经期', key: 'predicted-period' },
|
||||
{ label: '排卵期', key: 'fertile' },
|
||||
{ label: '排卵日', key: 'ovulation-day' },
|
||||
];
|
||||
|
||||
export const Legend: React.FC = () => {
|
||||
const { t } = useTranslation();
|
||||
const legendItems: LegendItem[] = [
|
||||
{ label: t('menstrual.legend.period'), key: 'period' },
|
||||
{ label: t('menstrual.legend.predictedPeriod'), key: 'predicted-period' },
|
||||
{ label: t('menstrual.legend.fertile'), key: 'fertile' },
|
||||
{ label: t('menstrual.legend.ovulation'), key: 'ovulation-day' },
|
||||
];
|
||||
|
||||
return (
|
||||
<View style={styles.legendRow}>
|
||||
{LEGEND_ITEMS.map((item) => (
|
||||
{legendItems.map((item) => (
|
||||
<View key={item.key} style={styles.legendItem}>
|
||||
<View
|
||||
style={[
|
||||
|
||||
Reference in New Issue
Block a user