mirror of
https://github.com/tooot-app/app
synced 2025-06-05 22:19:13 +02:00
Added support for KO and VI
This commit is contained in:
@ -3,8 +3,6 @@ import { RootState } from '@root/store'
|
||||
import * as Updates from 'expo-updates'
|
||||
import * as StoreReview from 'expo-store-review'
|
||||
|
||||
export const supportedLngs = ['zh-Hans', 'en']
|
||||
|
||||
export type ContextsState = {
|
||||
storeReview: {
|
||||
context: Readonly<number>
|
||||
|
@ -1,14 +1,10 @@
|
||||
import { createAsyncThunk, createSlice, PayloadAction } from '@reduxjs/toolkit'
|
||||
import { LOCALES } from '@root/i18n/locales'
|
||||
import { RootState } from '@root/store'
|
||||
import * as Analytics from 'expo-firebase-analytics'
|
||||
import * as Localization from 'expo-localization'
|
||||
import { pickBy } from 'lodash'
|
||||
|
||||
enum AvailableLanguages {
|
||||
'zh-Hans',
|
||||
'en'
|
||||
}
|
||||
|
||||
export const changeAnalytics = createAsyncThunk(
|
||||
'settings/changeAnalytics',
|
||||
async (newValue: SettingsState['analytics']) => {
|
||||
@ -31,12 +27,10 @@ export const settingsInitialState = {
|
||||
enabled: false
|
||||
},
|
||||
language: Object.keys(
|
||||
pickBy(AvailableLanguages, (_, key) => Localization.locale.includes(key))
|
||||
pickBy(LOCALES, (_, key) => Localization.locale.startsWith(key))
|
||||
)
|
||||
? Object.keys(
|
||||
pickBy(AvailableLanguages, (_, key) =>
|
||||
Localization.locale.includes(key)
|
||||
)
|
||||
pickBy(LOCALES, (_, key) => Localization.locale.startsWith(key))
|
||||
)[0]
|
||||
: 'en',
|
||||
theme: 'auto',
|
||||
@ -88,10 +82,6 @@ export const getSettingsBrowser = (state: RootState) => state.settings.browser
|
||||
export const getSettingsAnalytics = (state: RootState) =>
|
||||
state.settings.analytics
|
||||
|
||||
export const {
|
||||
changeFontsize,
|
||||
changeLanguage,
|
||||
changeTheme,
|
||||
changeBrowser
|
||||
} = settingsSlice.actions
|
||||
export const { changeFontsize, changeLanguage, changeTheme, changeBrowser } =
|
||||
settingsSlice.actions
|
||||
export default settingsSlice.reducer
|
||||
|
Reference in New Issue
Block a user