parseFtl

Convenience function to parse an FTL string into a Resource.

Quick Start

import dev.kbroom.fluent.*

// Create a bundle via the DSL
val bundle = fluentBundle(locales = listOf(LanguageIdentifier.parse("en"))) {
resource("hello = Hello, { $name }!")
builtins()
}

// Format
val args = fluentArgsOf("name" to "World")
val greeting = bundle.format("hello", args)
println(greeting) // "Hello, World!"