Languine supports FTL files, Mozilla's Fluent localization system. This powerful format handles complex translations including variables, selectors, attributes, and terms while maintaining a human-readable syntax.
First, make sure you've got a languine.json config file in your project root. Here's an example:
{ "locale": { "source": "en", "targets": ["sv", "de", "fr"] }, "files": { "ftl": { "include": ["locales/[locale].ftl"] } } }
With your config set, run:
npx languine@latest translate
When you run this command, Languine will:
welcome = Welcome! with-var = Welcome, { $name }!
emails = { $unreadEmails -> [one] You have one unread email. *[other] You have { $unreadEmails } unread emails. }
login-input = Predefined value .placeholder = email@example.com .aria-label = Login input value
-brand-name = Umbrella about = About { -brand-name }.
description = This is a long description that spans multiple lines. The indentation will be handled automatically.
# Regular comment ## Section comment ### Resource comment # Describing variables # $title (String) - The title of the bookmark remove-bookmark = Remove { $title }?