New Crowdin updates (#364)
* New translations en.json (Italian) * New translations en.json (Italian) * New translations en.json (Italian) * New translations en.json (Arabic) * feat: add it lang * New translations en.json (French) * New translations en.json (Spanish) * New translations en.json (Arabic) * New translations en.json (German) * New translations en.json (Hungarian) * New translations en.json (Japanese) * New translations en.json (Chinese Simplified) * New translations en.json (Indonesian) * New translations en.json (Korean) * New translations en.json (Italian) * New translations en.json (Arabic) * New translations en.json (Japanese) * New translations en.json (Indonesian) * New translations en.json (Indonesian) * New translations en.json (Italian) * New translations en.json (Italian) * New translations en.json (Italian) * New translations en.json (Italian) * New translations en.json (French) * New translations en.json (Spanish) * New translations en.json (Arabic) * New translations en.json (German) * New translations en.json (Hungarian) * New translations en.json (Japanese) * New translations en.json (Chinese Simplified) * New translations en.json (Indonesian) * New translations en.json (Korean) * New translations en.json (Italian) * New translations en.json (Arabic) * New translations en.json (Italian) * New translations en.json (Japanese) * New translations en.json (Indonesian) * New translations en.json (Italian) * Read preferences directly from localStorage * Add Indonesian to language picker * Update translators
This commit is contained in:
@ -24,7 +24,7 @@ export interface UserPreferences {
|
||||
/**
|
||||
* User selected language
|
||||
*/
|
||||
language?: "en" | "ja" | "es" | "hu" | "zh" | "fr" | "ar";
|
||||
language?: "en" | "ja" | "es" | "hu" | "zh" | "fr" | "ar" | "it" | "id";
|
||||
|
||||
/**
|
||||
* Enable reactions / reposts / zaps
|
||||
@ -255,6 +255,14 @@ export interface SetFollowsPayload {
|
||||
createdAt: number;
|
||||
}
|
||||
|
||||
export const ReadPreferences = () => {
|
||||
const pref = window.localStorage.getItem(UserPreferencesKey);
|
||||
if (pref) {
|
||||
return JSON.parse(pref) as UserPreferences;
|
||||
}
|
||||
return InitState.preferences;
|
||||
};
|
||||
|
||||
const LoginSlice = createSlice({
|
||||
name: "Login",
|
||||
initialState: InitState,
|
||||
@ -296,10 +304,8 @@ const LoginSlice = createSlice({
|
||||
}
|
||||
|
||||
// preferences
|
||||
const pref = window.localStorage.getItem(UserPreferencesKey);
|
||||
if (pref) {
|
||||
state.preferences = JSON.parse(pref);
|
||||
}
|
||||
const pref = ReadPreferences();
|
||||
state.preferences = pref;
|
||||
|
||||
// disable reactions for logged out
|
||||
if (state.loggedOut === true) {
|
||||
|
Reference in New Issue
Block a user