Skip to content

Commit

Permalink
feat: add user locale setting
Browse files Browse the repository at this point in the history
  • Loading branch information
boojack committed Sep 2, 2023
1 parent 96c1901 commit 98cb5a2
Show file tree
Hide file tree
Showing 7 changed files with 222 additions and 42 deletions.
31 changes: 31 additions & 0 deletions frontend/types/proto/store/user_setting_pb.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,31 @@ export declare enum UserSettingKey {
* @generated from enum value: USER_SETTING_ACCESS_TOKENS = 1;
*/
USER_SETTING_ACCESS_TOKENS = 1,

/**
* @generated from enum value: USER_SETTING_LOCALE = 2;
*/
USER_SETTING_LOCALE = 2,
}

/**
* @generated from enum slash.store.LocaleUserSetting
*/
export declare enum LocaleUserSetting {
/**
* @generated from enum value: LOCALE_USER_SETTING_UNSPECIFIED = 0;
*/
UNSPECIFIED = 0,

/**
* @generated from enum value: LOCALE_USER_SETTING_EN = 1;
*/
EN = 1,

/**
* @generated from enum value: LOCALE_USER_SETTING_ZH = 2;
*/
ZH = 2,
}

/**
Expand All @@ -44,6 +69,12 @@ export declare class UserSetting extends Message<UserSetting> {
*/
value: AccessTokensUserSetting;
case: "accessTokensUserSetting";
} | {
/**
* @generated from field: slash.store.LocaleUserSetting locale_user_setting = 4;
*/
value: LocaleUserSetting;
case: "localeUserSetting";
} | { case: undefined; value?: undefined };

constructor(data?: PartialMessage<UserSetting>);
Expand Down
14 changes: 14 additions & 0 deletions frontend/types/proto/store/user_setting_pb.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,19 @@ export const UserSettingKey = proto3.makeEnum(
[
{no: 0, name: "USER_SETTING_KEY_UNSPECIFIED"},
{no: 1, name: "USER_SETTING_ACCESS_TOKENS"},
{no: 2, name: "USER_SETTING_LOCALE"},
],
);

/**
* @generated from enum slash.store.LocaleUserSetting
*/
export const LocaleUserSetting = proto3.makeEnum(
"slash.store.LocaleUserSetting",
[
{no: 0, name: "LOCALE_USER_SETTING_UNSPECIFIED", localName: "UNSPECIFIED"},
{no: 1, name: "LOCALE_USER_SETTING_EN", localName: "EN"},
{no: 2, name: "LOCALE_USER_SETTING_ZH", localName: "ZH"},
],
);

Expand All @@ -25,6 +38,7 @@ export const UserSetting = proto3.makeMessageType(
{ no: 1, name: "user_id", kind: "scalar", T: 5 /* ScalarType.INT32 */ },
{ no: 2, name: "key", kind: "enum", T: proto3.getEnumType(UserSettingKey) },
{ no: 3, name: "access_tokens_user_setting", kind: "message", T: AccessTokensUserSetting, oneof: "value" },
{ no: 4, name: "locale_user_setting", kind: "enum", T: proto3.getEnumType(LocaleUserSetting), oneof: "value" },
],
);

Expand Down
16 changes: 16 additions & 0 deletions proto/gen/store/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
- [AccessTokensUserSetting.AccessToken](#slash-store-AccessTokensUserSetting-AccessToken)
- [UserSetting](#slash-store-UserSetting)

- [LocaleUserSetting](#slash-store-LocaleUserSetting)
- [UserSettingKey](#slash-store-UserSettingKey)

- [Scalar Value Types](#scalar-value-types)
Expand Down Expand Up @@ -208,6 +209,7 @@
| user_id | [int32](#int32) | | |
| key | [UserSettingKey](#slash-store-UserSettingKey) | | |
| access_tokens_user_setting | [AccessTokensUserSetting](#slash-store-AccessTokensUserSetting) | | |
| locale_user_setting | [LocaleUserSetting](#slash-store-LocaleUserSetting) | | |



Expand All @@ -216,6 +218,19 @@



<a name="slash-store-LocaleUserSetting"></a>

### LocaleUserSetting


| Name | Number | Description |
| ---- | ------ | ----------- |
| LOCALE_USER_SETTING_UNSPECIFIED | 0 | |
| LOCALE_USER_SETTING_EN | 1 | |
| LOCALE_USER_SETTING_ZH | 2 | |



<a name="slash-store-UserSettingKey"></a>

### UserSettingKey
Expand All @@ -225,6 +240,7 @@
| ---- | ------ | ----------- |
| USER_SETTING_KEY_UNSPECIFIED | 0 | |
| USER_SETTING_ACCESS_TOKENS | 1 | |
| USER_SETTING_LOCALE | 2 | |



Expand Down
167 changes: 125 additions & 42 deletions proto/gen/store/user_setting.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions proto/store/user_setting.proto
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,17 @@ message UserSetting {

oneof value {
AccessTokensUserSetting access_tokens_user_setting = 3;

LocaleUserSetting locale_user_setting = 4;
}
}

enum UserSettingKey {
USER_SETTING_KEY_UNSPECIFIED = 0;

USER_SETTING_ACCESS_TOKENS = 1;

USER_SETTING_LOCALE = 2;
}

message AccessTokensUserSetting {
Expand All @@ -27,3 +31,9 @@ message AccessTokensUserSetting {
}
repeated AccessToken access_tokens = 1;
}

enum LocaleUserSetting {
LOCALE_USER_SETTING_UNSPECIFIED = 0;
LOCALE_USER_SETTING_EN = 1;
LOCALE_USER_SETTING_ZH = 2;
}
Loading

0 comments on commit 98cb5a2

Please sign in to comment.