mirror of
https://github.com/mue/mue.git
synced 2026-07-28 11:11:08 +02:00
Refactor welcome modal and sections to use translation context
- Replaced variable-based message retrieval with translation context in Welcome.jsx, Final.jsx, ImportSettings.jsx, Intro.jsx, PrivacyOptions.jsx, StyleSelection.jsx, and ThemeSelection.jsx components. - Updated button texts and section titles to utilize the new translation method for better localization support. - Cleaned up unused imports and improved code readability by removing unnecessary else statements in deepLinking.js and load.js. - Ensured all localization files end with a newline for consistency.
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { useT } from 'contexts';
|
||||
import variables from 'config/variables';
|
||||
import { useState, useEffect, useRef } from 'react';
|
||||
|
||||
@@ -7,6 +8,7 @@ import EventBus from 'utils/eventbus';
|
||||
import './date.scss';
|
||||
|
||||
const DateWidget = () => {
|
||||
const t = useT();
|
||||
const [date, setDate] = useState('');
|
||||
const [weekNumber, setWeekNumber] = useState(null);
|
||||
const [display, setDisplay] = useState('block');
|
||||
@@ -29,7 +31,7 @@ const DateWidget = () => {
|
||||
dateToday.setMonth(0, 1 + ((4 - dateToday.getDay() + 7) % 7));
|
||||
}
|
||||
|
||||
const weekLabel = variables.getMessage('widgets.date.week');
|
||||
const weekLabel = t('widgets.date.week');
|
||||
const weekNum = 1 + Math.ceil((firstThursday - dateToday) / 604800000);
|
||||
const weekText = weekLabel.includes('{number}')
|
||||
? weekLabel.replace('{number}', weekNum)
|
||||
|
||||
Reference in New Issue
Block a user