1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
|
# rspolib
[](https://crates.io/crates/rspolib) [](https://pypi.org/project/rspolib) [](https://docs.rs/rspolib) [](https://github.com/mondeja/rspolib/blob/master/python/REFERENCE.md)
Port to Rust of the Python library [polib].
## Install
```bash
cargo add rspolib
```
## Usage
```rust
use rspolib::{pofile, prelude::*};
let po = pofile("./tests-data/flags.po").unwrap();
for entry in &po.entries {
println!("{}", entry.msgid);
}
po.save("./file.po");
```
See the documentation at [docs.rs/rspolib](https://docs.rs/rspolib)
## Python bindings
[](https://pypi.org/project/rspolib/#files)
- [Quickstart](https://github.com/mondeja/rspolib/tree/master/python#readme)
- [Reference](https://github.com/mondeja/rspolib/blob/master/python/REFERENCE.md)
### Usage
```python
import polib
import rspolib
rspo = rspolib.pofile(f"{tests_dir}/django-complete.po")
pypo = polib.pofile(f"{tests_dir}/django-complete.po")
```
[polib]: https://github.com/izimobil/polib
|