[Statsig] Send locale info (#3621)
parent
55aea348c2
commit
c42a557417
|
@ -6,6 +6,7 @@ import {Statsig, StatsigProvider} from 'statsig-react-native-expo'
|
||||||
|
|
||||||
import {logger} from '#/logger'
|
import {logger} from '#/logger'
|
||||||
import {isWeb} from '#/platform/detection'
|
import {isWeb} from '#/platform/detection'
|
||||||
|
import * as persisted from '#/state/persisted'
|
||||||
import {IS_TESTFLIGHT} from 'lib/app-info'
|
import {IS_TESTFLIGHT} from 'lib/app-info'
|
||||||
import {useSession} from '../../state/session'
|
import {useSession} from '../../state/session'
|
||||||
import {timeout} from '../async/timeout'
|
import {timeout} from '../async/timeout'
|
||||||
|
@ -23,6 +24,8 @@ type StatsigUser = {
|
||||||
platform: 'ios' | 'android' | 'web'
|
platform: 'ios' | 'android' | 'web'
|
||||||
refSrc: string
|
refSrc: string
|
||||||
refUrl: string
|
refUrl: string
|
||||||
|
appLanguage: string
|
||||||
|
contentLanguages: string[]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -132,6 +135,7 @@ function toStatsigUser(did: string | undefined): StatsigUser {
|
||||||
if (did) {
|
if (did) {
|
||||||
userID = sha256(did)
|
userID = sha256(did)
|
||||||
}
|
}
|
||||||
|
const languagePrefs = persisted.get('languagePrefs')
|
||||||
return {
|
return {
|
||||||
userID,
|
userID,
|
||||||
platform: Platform.OS as 'ios' | 'android' | 'web',
|
platform: Platform.OS as 'ios' | 'android' | 'web',
|
||||||
|
@ -139,6 +143,8 @@ function toStatsigUser(did: string | undefined): StatsigUser {
|
||||||
refSrc,
|
refSrc,
|
||||||
refUrl,
|
refUrl,
|
||||||
platform: Platform.OS as 'ios' | 'android' | 'web',
|
platform: Platform.OS as 'ios' | 'android' | 'web',
|
||||||
|
appLanguage: languagePrefs.appLanguage,
|
||||||
|
contentLanguages: languagePrefs.contentLanguages,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue