fix(i18n): prioritize user settings over Accept-Language header
The i18n middleware runs before UserAuth, so user settings weren't available when language was detected. Now GetLangFromContext checks user settings first (set by UserAuth) before falling back to the language set by middleware or Accept-Language header.
This commit is contained in:
1 parent
194e89de12
commit
a78c1c9be9
8 files changed
+69
-17
No files matched your search
@@ -491,7 +491,7 @@ export const useChannelsData = () => {
|
||||
}
|
||||
const { success, message } = res.data;
|
||||
if (success) {
|
||||
showSuccess('操作成功完成!');
|
||||
showSuccess(t('操作成功完成!'));
|
||||
let newChannels = [...channels];
|
||||
for (let i = 0; i < newChannels.length; i++) {
|
||||
if (newChannels[i].tag === tag) {
|
||||
|
||||
@@ -145,7 +145,7 @@ export const useRedemptionsData = () => {
|
||||
|
||||
const { success, message } = res.data;
|
||||
if (success) {
|
||||
showSuccess('操作成功完成!');
|
||||
showSuccess(t('操作成功完成!'));
|
||||
let redemption = res.data.data;
|
||||
let newRedemptions = [...redemptions];
|
||||
if (action !== REDEMPTION_ACTIONS.DELETE) {
|
||||
|
||||
@@ -174,7 +174,7 @@ export const useTokensData = (openFluentNotification) => {
|
||||
}
|
||||
const { success, message } = res.data;
|
||||
if (success) {
|
||||
showSuccess('操作成功完成!');
|
||||
showSuccess(t('操作成功完成!'));
|
||||
let token = res.data.data;
|
||||
let newTokens = [...tokens];
|
||||
if (action !== 'delete') {
|
||||
|
||||
@@ -132,7 +132,7 @@ export const useUsersData = () => {
|
||||
|
||||
const { success, message } = res.data;
|
||||
if (success) {
|
||||
showSuccess('操作成功完成!');
|
||||
showSuccess(t('操作成功完成!'));
|
||||
const user = res.data.data;
|
||||
|
||||
// Create a new array and new object to ensure React detects changes
|
||||
|
||||
Reference in new issue
Block a user