Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kkostov/hb-rs-xliff
Library for reading and writing localized text stored in XLIFF format.
https://github.com/kkostov/hb-rs-xliff
cargo i18n localization rust xliff
Last synced: about 4 hours ago
JSON representation
Library for reading and writing localized text stored in XLIFF format.
- Host: GitHub
- URL: https://github.com/kkostov/hb-rs-xliff
- Owner: kkostov
- License: apache-2.0
- Created: 2019-07-12T14:20:48.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-09-11T14:03:11.000Z (about 4 years ago)
- Last Synced: 2024-09-14T18:44:30.670Z (2 months ago)
- Topics: cargo, i18n, localization, rust, xliff
- Language: Rust
- Homepage:
- Size: 46.9 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
XLIFF Parser
====================[![Build Status](https://travis-ci.com/kkostov/hb-rs-xliff.svg?branch=master)](https://travis-ci.com/kkostov/hb-rs-xliff)
This is a library for reading and writing localized text stored in XLIFF format.
[Docs](https://docs.rs/xliff)
⚠ This is work in progress - check below for the current status of the implementation.
## Examples
### Reading XLIFF file
```rust no-run
let path: PathBuf = [env!("CARGO_MANIFEST_DIR"), "tests", "simplev1_2.xliff"]
.iter()
.collect();
let translations = T::load(&path);let translation = translations.t(None, "Some text");
assert_eq!(
translation.source_text().unwrap(),
"Some text"
);
assert_eq!(
translation.target_text().unwrap(),
"je précise quelque chose de très..."
);
```### Reading XLIFF string
```rust no-run
let xliff_string = r#"
HelloWidgets
HelloWidgets Translated
Bundle name
"#;let translations = T::load_str(xliff_string);
let translation = translations.t(None, "CFBundleName");```
## Changelog[Version history](./CHANGELOG.md)
## Parse XLIFF 1.2
[Spec](http://docs.oasis-open.org/xliff/v1.2/os/xliff-core.html)
### Implementation status
.
- [ ] ``
- [x] ``
- [x] ``
- [ ] ``
- [ ] ` | `
- [ ] ``
- [ ] ``
- [ ] `note`
- [ ] ``
- [ ] ` | `
- [ ] ``
- [ ] ` | `
- [ ] ``
- [ ] ``
- [x] ``
- [ ] ``
- [ ] ``
- [x] ``
- [x] ``
- [ ] ``
- [ ] ``
- [ ] ``
- [ ] ``
- [ ] ``
- [ ] ``
- [ ] ``
- [ ] ``
- [x] ``
- [x] ``
- [x] ``
- [ ] ``
- [ ] ``
- [ ] ``
- [ ] ``
- [ ] ``
- [ ] ``
- [ ] ``
- [x] ``
- [ ] ``
- [ ] ``
- [ ] ``
- [ ] ``
- [ ] ``
- [ ] ``
- [ ] ``
- [ ] ``
- [ ] ``
- [ ] ``
- [ ] ``
- [ ] ``
## Acknowledgements
* Depends on [quick-xml](https://crates.io/crates/quick-xml)
* The names "OASIS" and "XLIFF" are trademarks of [OASIS](https://www.oasis-open.org/),
the owner and developer of the XLIFF specification.