feat: Enhance Oxygen Saturation Card with health permissions and loading state management

feat(i18n): Add common translations and mood-related strings in English and Chinese

fix(i18n): Update metabolism titles for consistency in health translations

chore: Update Podfile.lock to include SDWebImage 5.21.4 and other dependency versions

refactor(moodCheckins): Improve mood configuration retrieval with optional translation support

refactor(sleepHealthKit): Replace useI18n with direct i18n import for sleep quality descriptions
This commit is contained in:
2025-11-28 23:48:38 +08:00
parent bca6670390
commit 83b77615cf
19 changed files with 512 additions and 254 deletions

View File

@@ -2,4 +2,13 @@ export const dateSelector = {
backToToday: 'Back to Today',
cancel: 'Cancel',
confirm: 'Confirm',
};
};
export const common = {
alert: 'Alert',
success: 'Success',
error: 'Error',
delete: 'Delete',
confirm: 'Confirm',
cancel: 'Cancel',
};

View File

@@ -98,7 +98,7 @@ export const statistics = {
addButton: '+ {{amount}}ml',
},
metabolism: {
title: 'Basal Metabolism',
title: 'Metabolism',
loading: 'Loading...',
unit: 'kcal/day',
status: {
@@ -406,7 +406,7 @@ export const circumferenceDetail = {
};
export const basalMetabolismDetail = {
title: 'Basal Metabolism',
title: 'Metabolism',
currentData: {
title: '{{date}} Basal Metabolism',
unit: 'kcal',

View File

@@ -3,6 +3,7 @@ import * as Common from './common';
import * as Diet from './diet';
import * as Health from './health';
import * as Medication from './medication';
import * as Mood from './mood';
import * as Personal from './personal';
import * as Weight from './weight';
@@ -13,5 +14,7 @@ export default {
...Medication,
...Weight,
...Challenge,
...Mood,
...Common,
...Common.common, // 确保通用翻译被正确导出
};

95
i18n/en/mood.ts Normal file
View File

@@ -0,0 +1,95 @@
export const mood = {
calendar: {
title: 'Mood Calendar',
weekDays: {
monday: 'Mon',
tuesday: 'Tue',
wednesday: 'Wed',
thursday: 'Thu',
friday: 'Fri',
saturday: 'Sat',
sunday: 'Sun',
},
months: {
january: 'Jan',
february: 'Feb',
march: 'Mar',
april: 'Apr',
may: 'May',
june: 'Jun',
july: 'Jul',
august: 'Aug',
september: 'Sep',
october: 'Oct',
november: 'Nov',
december: 'Dec',
},
selectedDate: {
selectDate: 'Please select a date',
record: 'Record',
noRecord: 'No mood records',
noRecordHint: 'Click the "Record" button in the top right to add mood',
noDateSelected: 'Please select a date first',
noDateSelectedHint: 'Click a date in the calendar, then click the "Record" button to add mood',
intensity: 'Intensity',
dateFormat: 'MMMM D, YYYY',
},
errors: {
loadMonthDataFailed: 'Failed to load monthly mood data',
loadDailyDataFailed: 'Failed to load mood records',
},
},
types: {
happy: 'Happy',
excited: 'Excited',
thrilled: 'Thrilled',
calm: 'Calm',
anxious: 'Anxious',
sad: 'Sad',
lonely: 'Lonely',
wronged: 'Wronged',
angry: 'Angry',
tired: 'Tired',
},
edit: {
title: 'Record Mood',
editTitle: 'Edit Mood',
selectMood: 'Select Mood',
intensity: 'Mood Intensity',
intensityLow: 'Low',
intensityHigh: 'High',
diary: 'Mood Diary',
diarySubtitle: 'Record your feelings and cherish beautiful memories',
placeholder: `How are you feeling today?
Did you experience anything special?
What made you happy?
Or, what's bothering you?
Write down your feelings and let these moments become your precious memories...`,
save: 'Save Mood',
update: 'Update Mood',
saving: 'Saving...',
dateFormat: 'MMMM D, YYYY',
alerts: {
selectMood: 'Please select a mood',
saveSuccess: 'Mood record saved',
updateSuccess: 'Mood record updated',
deleteSuccess: 'Mood record deleted',
saveError: 'Failed to save mood, please try again',
deleteError: 'Failed to delete mood, please try again',
confirmDelete: 'Are you sure you want to delete this mood record?',
confirmDeleteTitle: 'Confirm Delete',
},
},
history: {
title: 'Mood Records',
noRecords: 'No mood records',
totalRecords: 'Total Records',
averageIntensity: 'Average Intensity',
mostFrequent: 'Most Frequent',
recentRecords: 'Recent Records',
intensity: 'Intensity',
dateTimeFormat: 'MM/DD HH:mm',
},
};