mirror of
https://github.com/ankitects/anki.git
synced 2025-11-28 15:37:13 -05:00
Realised this is clearer than tagging each method individually. The enum has been retained for the case where we want to implement the backend method separately from the collection one.
51 lines
1.1 KiB
Protocol Buffer
51 lines
1.1 KiB
Protocol Buffer
// Copyright: Ankitects Pty Ltd and contributors
|
|
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|
|
|
syntax = "proto3";
|
|
|
|
option java_multiple_files = true;
|
|
|
|
package anki.i18n;
|
|
|
|
import "anki/generic.proto";
|
|
import "anki/codegen.proto";
|
|
|
|
service I18nService {
|
|
rpc TranslateString(TranslateStringRequest) returns (generic.String) {
|
|
option (codegen.backend_method) = BACKEND_METHOD_IMPLEMENT;
|
|
}
|
|
rpc FormatTimespan(FormatTimespanRequest) returns (generic.String) {
|
|
option (codegen.backend_method) = BACKEND_METHOD_IMPLEMENT;
|
|
}
|
|
rpc I18nResources(I18nResourcesRequest) returns (generic.Json) {
|
|
option (codegen.backend_method) = BACKEND_METHOD_IMPLEMENT;
|
|
}
|
|
}
|
|
|
|
message TranslateStringRequest {
|
|
uint32 module_index = 1;
|
|
uint32 message_index = 2;
|
|
map<string, TranslateArgValue> args = 3;
|
|
}
|
|
|
|
message TranslateArgValue {
|
|
oneof value {
|
|
string str = 1;
|
|
double number = 2;
|
|
}
|
|
}
|
|
|
|
message FormatTimespanRequest {
|
|
enum Context {
|
|
PRECISE = 0;
|
|
ANSWER_BUTTONS = 1;
|
|
INTERVALS = 2;
|
|
}
|
|
|
|
float seconds = 1;
|
|
Context context = 2;
|
|
}
|
|
|
|
message I18nResourcesRequest {
|
|
repeated string modules = 1;
|
|
}
|