Skip to content

Commit 83a77c1

Browse files
feat: add defaultUserLanguage + preferredLanguage keys in typings [UFO-1659] (#2894)
1 parent 3db2a7b commit 83a77c1

3 files changed

Lines changed: 14 additions & 0 deletions

File tree

lib/entities/organization.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@ export type OrganizationProps = {
1919
* Name
2020
*/
2121
name: string
22+
/**
23+
* Default language used in the interface and email communications.
24+
* Users can override this setting in their profile settings.
25+
* If not set, the default value is `en-US`.
26+
*/
27+
defaultUserLanguage: string
2228
}
2329

2430
/**

lib/entities/user.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,12 @@ export type UserProps = {
4747

4848
'2faEnabled': boolean
4949
cookieConsentData: string
50+
/**
51+
* Language used in the interface and email communications.
52+
* Overrides the organization default language.
53+
* If not set, the default value is `en-US`.
54+
*/
55+
preferredLanguage: string
5056
}
5157

5258
export interface User extends UserProps, DefaultElements<UserProps> {}

test/unit/mocks/entities.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,7 @@ const userMock: UserProps = {
208208
confirmed: true,
209209
'2faEnabled': true,
210210
cookieConsentData: 'mocked',
211+
preferredLanguage: 'en-US',
211212
}
212213

213214
const personalAccessTokenMock: PersonalAccessTokenProps = {
@@ -1055,6 +1056,7 @@ const organizationMock: OrganizationProps = {
10551056
type: 'Organization',
10561057
}),
10571058
name: 'name',
1059+
defaultUserLanguage: 'en-US',
10581060
}
10591061

10601062
const usageMock: UsageProps = {

0 commit comments

Comments
 (0)