fluent-rs icon indicating copy to clipboard operation
fluent-rs copied to clipboard

Conversion between .ftl and .po file

Open simrankedia opened this issue 4 years ago • 2 comments

Hi,

I am planning to use fluent-bundle for a localisation project in Rust. The features supported fits perfectly with my requirement. However, there is one major caveat - the translated files I will receive is supposed to be in .po format. Are there tools available to convert .ftl format to .po format?

simrankedia avatar Sep 06 '21 19:09 simrankedia

Which direction do you need to convert? poftl might be possible, but ftlpo is highly unlikely to get vary far. Fluent is simply a much more expressive format and if any of that expressiveness at all is used it simply can't be squashed back into po.

alerque avatar Sep 06 '21 19:09 alerque

I need either way - basically generate ftl -> po-> translators -> po -> ftl. Can you direct me to any tools available for po -> ftl? Also any starting point for the reverse conversion?

simrankedia avatar Sep 06 '21 21:09 simrankedia

Yeah I don't think there is one, and I don't know think one would live in fluent-rs. This seems like something that could be maintained as a separate tool.

gregtatum avatar Nov 07 '22 13:11 gregtatum

For anybody researching this, keep in mind that it would be impossible for any such tool to be lossless and support all Fluent features. I think it would be possible to support all PO functionality using a subset of Fluent, but not the other way around.

alerque avatar Nov 07 '22 14:11 alerque

Also for other prior art see https://github.com/mozilla/properties-to-ftl

This is Mozilla's tool for helping with migrating from .properties files to .ftl.

gregtatum avatar Nov 07 '22 15:11 gregtatum