Skip to content

Locale API

Method NameRequest TypeResponse TypeDescription
LocaleSetLocaleMessageEmptySystem-wide locale broadcast
TimezoneSetTimezoneMessageEmptySystem-wide timezone broadcast

Empty message

FieldTypeLabelDescription
keyLocaleMacroKeye.g., LC_TIME, LC_NUMERIC
valuestringe.g., en_US.UTF-8
FieldTypeLabelDescription
assignmentsLocaleAssignmentrepeatedList of locale assignments
FieldTypeLabelDescription
TimezonestringString with timezone value. Format: tz database name, usually Area/City or Etc/GMT+3.

Locale macros as defined in locale(7)

NameNumberDescription
LANG0
LC_ADDRESS1
LC_COLLATE2
LC_CTYPE3
LC_IDENTIFICATION4
LC_MONETARY5
LC_MESSAGES6
LC_MEASUREMENT7
LC_NAME8
LC_NUMERIC9
LC_PAPER10
LC_TELEPHONE11
LC_TIME12
LC_ALL13
.proto TypeNotesGo Type
doublefloat64
floatfloat32
int32Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead.int32
int64Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead.int64
uint32Uses variable-length encoding.uint32
uint64Uses variable-length encoding.uint64
sint32Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s.int32
sint64Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s.int64
fixed32Always four bytes. More efficient than uint32 if values are often greater than 2^28.uint32
fixed64Always eight bytes. More efficient than uint64 if values are often greater than 2^56.uint64
sfixed32Always four bytes.int32
sfixed64Always eight bytes.int64
boolbool
stringA string must always contain UTF-8 encoded or 7-bit ASCII text.string
bytesMay contain any arbitrary sequence of bytes.[]byte