1 个不稳定版本
| 0.1.0 | 2021年10月20日 |
|---|
#5 in #po
15KB
300 代码行数(不含注释)
PO
po 是一个用于读取和写入 PO 翻译文件的 Rust crate。
用法
要解析 .po 或 .pot 文件,只需创建一个新的 PoFile
let file = PoFile::new("<PATH>").unwrap();
要更新从文件 PoFile 生成的文件,使用 update()
let file = PoFile::new("<PATH>").unwrap();
file.update().unwrap();
要将 PoFile 写入另一个文件,使用 write(path)
let file = PoFile::new("<PATH>").unwrap();
file.write("<ANOTHER PATH>").unwrap();
要获取与文件等价的 String 的 PoFile,使用 to_string()
let file = PoFile::new("<PATH>").unwrap();
let data = file.to_string();
// Content in `data` will be the same as the one written using `write` or `update`.
依赖项
~1.5MB
~37K SLoC