Skip to content

Commit

Permalink
rename language field to locale
Browse files Browse the repository at this point in the history
  • Loading branch information
FZambia committed Mar 14, 2024
1 parent c686f12 commit 57906c1
Show file tree
Hide file tree
Showing 11 changed files with 622 additions and 609 deletions.
1,139 changes: 569 additions & 570 deletions internal/apiproto/api.pb.go

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions internal/apiproto/api.proto
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,7 @@ message DeviceRegisterRequest {
map<string, string> meta = 6;
repeated string topics = 7;
string timezone = 8;
string language = 9;
string locale = 9;
}

message DeviceUpdateRequest {
Expand All @@ -590,7 +590,7 @@ message DeviceUpdateRequest {
DeviceMetaUpdate meta_update = 5;
DeviceTopicsUpdate topics_update = 6;
DeviceTimezoneUpdate timezone_update = 7;
DeviceLanguageUpdate language_update = 8;
DeviceLocaleUpdate locale_update = 8;
}

message DeviceRemoveRequest {
Expand All @@ -606,8 +606,8 @@ message DeviceTimezoneUpdate {
string timezone = 1;
}

message DeviceLanguageUpdate {
string language = 1;
message DeviceLocaleUpdate {
string locale = 1;
}

message DeviceMetaUpdate {
Expand Down Expand Up @@ -752,7 +752,7 @@ message Device {
map<string, string> meta = 10;
repeated string topics = 11;
string timezone = 12;
string language = 13;
string locale = 13;
}

message DeviceTopicListResult {
Expand Down Expand Up @@ -828,13 +828,13 @@ message SendPushNotificationRequest {
bool optimize_for_reliability = 5; // makes processing heavier, but tolerates edge cases, like not loosing inflight pushes due to temporary queue unavailability.
PushLimitStrategy limit_strategy = 6; // strategy for sending push notifications. Applicable only for pushes with filter recipient. When using this field Centrifugo processes devices one by one.
string analytics_uid = 7; // uid for push notification analytics, if not set - Centrifugo will use uid field.
map<string, PushLocalization> localizations = 8; // optional per language localizations for push notification.
map<string, PushLocalization> localizations = 8; // optional per language/locale localizations for push notification.
bool use_templating = 9; // if set - Centrifugo will use templating for push notification. Note that setting localizations enables templating automatically.
bool use_meta = 10; // if set - Centrifugo will additionally load device meta during push sending, this meta becomes available in templating.
}

message PushLocalization {
map<string, string> translations = 1; // variable name to value for the specific language.
map<string, string> translations = 1; // variable name to value for the specific language/locale.
}

message PushLimitStrategy {
Expand Down
42 changes: 26 additions & 16 deletions internal/apiproto/api.swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -1766,7 +1766,7 @@
"timezone": {
"type": "string"
},
"language": {
"locale": {
"type": "string"
}
}
Expand Down Expand Up @@ -1806,14 +1806,6 @@
}
}
},
"DeviceLanguageUpdate": {
"type": "object",
"properties": {
"language": {
"type": "string"
}
}
},
"DeviceListRequest": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -1867,6 +1859,14 @@
}
}
},
"DeviceLocaleUpdate": {
"type": "object",
"properties": {
"locale": {
"type": "string"
}
}
},
"DeviceMetaUpdate": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -1911,7 +1911,7 @@
"timezone": {
"type": "string"
},
"language": {
"locale": {
"type": "string"
}
}
Expand Down Expand Up @@ -2150,8 +2150,8 @@
"timezone_update": {
"$ref": "#/definitions/DeviceTimezoneUpdate"
},
"language_update": {
"$ref": "#/definitions/DeviceLanguageUpdate"
"locale_update": {
"$ref": "#/definitions/DeviceLocaleUpdate"
}
}
},
Expand Down Expand Up @@ -2632,7 +2632,7 @@
"additionalProperties": {
"type": "string"
},
"description": "variable name to value for the specific language."
"description": "variable name to value for the specific language/locale."
}
}
},
Expand All @@ -2659,7 +2659,7 @@
"properties": {
"key": {
"type": "string",
"description": "key for rate limit policy, supports variables (user_id, device_id)."
"description": "optional key for rate limit policy, supports variables."
},
"policies": {
"type": "array",
Expand Down Expand Up @@ -2724,7 +2724,7 @@
},
"no_tz_send_now": {
"type": "boolean",
"description": "If device timezone is not set - send push now."
"description": "If device timezone is not set - send push now, by default will be dropped."
}
}
},
Expand Down Expand Up @@ -2799,6 +2799,16 @@
"Reply": {
"type": "object",
"properties": {
"id": {
"type": "integer",
"format": "int64"
},
"error": {
"$ref": "#/definitions/Error"
},
"result": {
"type": "object"
},
"publish": {
"$ref": "#/definitions/PublishResult"
},
Expand Down Expand Up @@ -2956,7 +2966,7 @@
"additionalProperties": {
"$ref": "#/definitions/PushLocalization"
},
"description": "optional per language localizations for push notification."
"description": "optional per language/locale localizations for push notification."
},
"use_templating": {
"type": "boolean",
Expand Down
22 changes: 13 additions & 9 deletions internal/apiproto/api.swagger.proto
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,10 @@ message Error {
}

message Reply {
uint32 id = 1;
Error error = 2;
bytes result = 3;

PublishResult publish = 4;
BroadcastResult broadcast = 5;
SubscribeResult subscribe = 6;
Expand Down Expand Up @@ -911,7 +915,7 @@ message DeviceRegisterRequest {
map<string, string> meta = 6;
repeated string topics = 7;
string timezone = 8;
string language = 9;
string locale = 9;
}

message DeviceUpdateRequest {
Expand All @@ -922,7 +926,7 @@ message DeviceUpdateRequest {
DeviceMetaUpdate meta_update = 5;
DeviceTopicsUpdate topics_update = 6;
DeviceTimezoneUpdate timezone_update = 7;
DeviceLanguageUpdate language_update = 8;
DeviceLocaleUpdate locale_update = 8;
}

message DeviceRemoveRequest {
Expand All @@ -938,8 +942,8 @@ message DeviceTimezoneUpdate {
string timezone = 1;
}

message DeviceLanguageUpdate {
string language = 1;
message DeviceLocaleUpdate {
string locale = 1;
}

message DeviceMetaUpdate {
Expand Down Expand Up @@ -1084,7 +1088,7 @@ message Device {
map<string, string> meta = 10;
repeated string topics = 11;
string timezone = 12;
string language = 13;
string locale = 13;
}

message DeviceTopicListResult {
Expand Down Expand Up @@ -1160,13 +1164,13 @@ message SendPushNotificationRequest {
bool optimize_for_reliability = 5; // makes processing heavier, but tolerates edge cases, like not loosing inflight pushes due to temporary queue unavailability.
PushLimitStrategy limit_strategy = 6; // strategy for sending push notifications. Applicable only for pushes with filter recipient. When using this field Centrifugo processes devices one by one.
string analytics_uid = 7; // uid for push notification analytics, if not set - Centrifugo will use uid field.
map<string, PushLocalization> localizations = 8; // optional per language localizations for push notification.
map<string, PushLocalization> localizations = 8; // optional per language/locale localizations for push notification.
bool use_templating = 9; // if set - Centrifugo will use templating for push notification. Note that setting localizations enables templating automatically.
bool use_meta = 10; // if set - Centrifugo will additionally load device meta during push sending, this meta becomes available in templating.
}

message PushLocalization {
map<string, string> translations = 1; // variable name to value for the specific language.
map<string, string> translations = 1; // variable name to value for the specific language/locale.
}

message PushLimitStrategy {
Expand All @@ -1177,11 +1181,11 @@ message PushLimitStrategy {
message PushTimeLimitStrategy {
string send_after_time = 1; // HH:MM:SS
string send_before_time = 2; // HH:MM:SS
bool no_tz_send_now = 3; // If device timezone is not set - send push now.
bool no_tz_send_now = 3; // If device timezone is not set - send push now, by default will be dropped.
}

message PushRateLimitStrategy {
string key = 1; // key for rate limit policy, supports variables (user_id, device_id).
string key = 1; // optional key for rate limit policy, supports variables.
repeated RateLimitPolicy policies = 2;
bool drop_if_rate_limited = 3;
}
Expand Down
2 changes: 1 addition & 1 deletion internal/apiproto/api_grpc.pb.go

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

2 changes: 1 addition & 1 deletion internal/proxyproto/proxy.pb.go

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

2 changes: 1 addition & 1 deletion internal/proxyproto/proxy_grpc.pb.go

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

2 changes: 1 addition & 1 deletion internal/swaggerui/statik.go

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion internal/unigrpc/unistream/unistream.pb.go

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

2 changes: 1 addition & 1 deletion internal/unigrpc/unistream/unistream_grpc.pb.go

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

2 changes: 1 addition & 1 deletion internal/webui/statik.go

Large diffs are not rendered by default.

0 comments on commit 57906c1

Please sign in to comment.