https://github.com/johnnyjayjay/javidaloca
Java bindings for the Project Fluent Rust implementation (fluent-rs).
https://github.com/johnnyjayjay/javidaloca
hacktoberfest java jni localization projectfluent rust
Last synced: about 1 year ago
JSON representation
Java bindings for the Project Fluent Rust implementation (fluent-rs).
- Host: GitHub
- URL: https://github.com/johnnyjayjay/javidaloca
- Owner: JohnnyJayJay
- License: other
- Created: 2020-04-02T14:52:48.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-07-14T19:47:18.000Z (almost 6 years ago)
- Last Synced: 2025-03-22T02:02:48.678Z (about 1 year ago)
- Topics: hacktoberfest, java, jni, localization, projectfluent, rust
- Language: Java
- Homepage: https://projectfluent.org/
- Size: 116 KB
- Stars: 9
- Watchers: 1
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# javidaloca
WIP Java bindings for the Project Fluent Rust implementation.
## TODO
- [x] Mirror basic API
- [ ] Add Java API for custom types
- [ ] Add Java API for custom functions
- [ ] Setup proper gradle/cargo workflow
- [ ] Write javadoc
- [x] Resolve [fluent-rs issue #172](https://github.com/projectfluent/fluent-rs/issues/172)
## Usage
```java
FluentBundle bundle = FluentBundle.create(Locale.US);
bundle.addResource("score = { $name } scores { $points } points! Yay!", false);
FluentArgs args = FluentArgs.create()
.insert("name", "Johnny")
.insert("points", 27.5);
String message = bundle.formatMessage("score", args).orElse("Message not found...");
System.out.println(message); // => Johnny scores 27.5 points! Yay!
```
## See
- [Project Fluent](https://projectfluent.org)
- [Rust implementation](https://github.com/projectfluent/fluent-rs)