File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import { makeAutoObservable } from "mobx";
3
3
import { authServiceClient , inboxServiceClient , userServiceClient } from "@/grpcweb" ;
4
4
import { Inbox } from "@/types/proto/api/v1/inbox_service" ;
5
5
import { Shortcut , User , UserSetting , UserStats } from "@/types/proto/api/v1/user_service" ;
6
+ import { findNearestMatchedLanguage } from "@/utils/i18n" ;
6
7
import workspaceStore from "./workspace" ;
7
8
8
9
class LocalState {
@@ -223,7 +224,11 @@ export const initialUserStore = async () => {
223
224
appearance : userSetting . appearance ,
224
225
} ) ;
225
226
} catch {
226
- // Do nothing.
227
+ // find the nearest matched lang based on the `navigator.language` if the user is unauthenticated or settings retrieval fails.
228
+ const locale = findNearestMatchedLanguage ( navigator . language ) ;
229
+ workspaceStore . state . setPartial ( {
230
+ locale : locale ,
231
+ } ) ;
227
232
}
228
233
} ;
229
234
You can’t perform that action at this time.
0 commit comments