protoc: add Chinese translation (#9313)

pull/1/head
Ethan Liu 2022-10-25 17:11:47 +08:00 committed by GitHub
parent 38f9331440
commit ef8d207a06
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 16 additions and 0 deletions

16
pages.zh/common/protoc.md Normal file
View File

@ -0,0 +1,16 @@
# protoc
> 解析 Google Protobuf `.proto` 文件并生成指定语言的输出。
> 更多信息:<https://developers.google.com/protocol-buffers>.
- 从 `.proto` 文件生成 Python 代码:
`protoc --python_out={{路径/到/输出目录}} {{输入文件.proto}}`
- 从一个导入其他 `.proto` 文件的 `.proto` 文件生成 Java 代码:
`protoc --java_out={{路径/到/输出目录}} --proto_path={{路径/到/导入搜索路径}} {{输入文件.proto}}`
- 生成多种语言的代码:
`protoc --csharp_out={{路径/到/c#_输出目录}} --js_out={{路径/到/js_输出目录}} {{输入文件.proto}}`