Skip to content

Instantly share code, notes, and snippets.

@lenage
Last active October 26, 2022 04:57
Show Gist options
  • Save lenage/206eac4ea86be4700c1e03995f93d11d to your computer and use it in GitHub Desktop.
Save lenage/206eac4ea86be4700c1e03995f93d11d to your computer and use it in GitHub Desktop.
I18n your text field
// byted/api/i18n.proto
extend google.protobuf.FieldOptions {
// A Language annoation of a field
// in protobuf messages.
//
// Examples:
//
// string name = 1 [(byted.api.language)="en"];
// string desc = 2 [(byted.api.language)="en",
// (byted.api.language)="zh"];
// for language code, see full list at below url
// https://developers.google.com/admin-sdk/directory/v1/languages
repeated string language = 62001;
}
message ExampleText {
string name = 1 [(byted.api.language)="en"];
string desc = 2 [(byted.api.language)="en",
(byted.api.language)="zh"];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment