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:
2023-02-28 10:24:55 +00:00
committed by GitHub
parent 5f6f8f5c44
commit 2e78da732a
14 changed files with 451 additions and 124 deletions

View File

@ -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) {