New week, new Rust! What are you folks up to?
I've just released the first ready for use version of fluent-templates
a new high level API for adding Fluent localisation to your projects.
Example
Fluent
# In `locales/en-US/main.ftl`
hello-world = Hello World!
# In `locales/fr/main.ftl`
hello-world = Bonjour le monde!
# In `locales/de/main.ftl`
hello-world = Hallo Welt!
Rust Code
use unic_langid::{LanguageIdentifier, langid};
const EN_US: LanguageIdentifier = langid!("en-US");
const FR: LanguageIdentifier = langid!("fr");
fluent_templates::static_loader! {
static LOCALES = {
// Loaded at compile-time.
locales: "./tests/locales",
fallback_language: "en-US",
};
}
fn main() {
assert_eq!("Hello World!", LOCALES.lookup(&EN_US, "hello-world"));
assert_eq!("Bonjour le monde!", LOCALES.lookup(&FR, "hello-world"));
}
Continuing working on Git Interactive Rebase Tool, which is a sequence editor for Git written in Rust using Ncurses.
Last week I finished a major rewrite of the text rendering system. This week I am adding the ability to view a commit diff during editing the TODO file. I've been working on the feature on and off for a few months now, but keep having to make unrelated changes to support the feature, so hopefully this week will be the one.
Refreshing my Rust Know How and writing/collecting some important notes across several Forum Answers. For me it will be fine to have a Comparison between C and common Rust without using unsafe parts.
We will see
This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.