#fluent #localization #ast-node #parser #resources #codec

fluent4rs

Parser / codec for Fluent FTL files, written for lingora (a localization management program), and may be found to be useful outside of that context. It is not intended to replace any aspects of the fluent-rs crate implemented by Project Fluent, and, for the majority of language translation needs, the reader is referred back to that crate

12 stable releases

new 2.1.1 Mar 12, 2025
2.0.3 Mar 11, 2025
1.0.9 Mar 9, 2025
1.0.1 Feb 28, 2025
0.1.41 Feb 27, 2025

#35 in Internationalization (i18n)

Download history 387/week @ 2025-02-25 896/week @ 2025-03-04

1,283 downloads per month

MIT license

97KB
2K SLoC

fluent4rs

MIT License Language Build Coverage Version

Site | GitHub | API | Coverage Report

A Fluent (language translation) resource file codec.

Background

The fluent-syntax crate from Project Fluent parses Fluent FTL files. It provides a deserialisation only from the Resource level.

This crate:

  • enables conversion in both directions for any node in the syntax tree,
  • provides a syntax tree walker.

It has been written for lingora (a localization management program), and may be found to be useful outside of that context.

It is not intended to replace any aspects of the fluent-rs crate implemented by Project Fluent, and, for the majority of language translation needs, the reader is referred back to that crate.

Usage fluent4rs fluent-syntax
Programmatic inspection & editing of ftl files ?
Language translation in a program x fluent

Features

Feature Description
default All features are disabled
hash Allow AST nodes to be hashed, for potential usages in HashMaps
serde Allow AST nodes to be serialised / deserialised
trace Include tracing to stderr in the DefaultVisitor implementation
walker Provide AST walker and visitors

Development

cargo test --all-features

AST Image View

Railroad

Relationships

Dependencies

~0.9–1.5MB
~27K SLoC