projectfluent / fluent-rs

Rust implementation of Project Fluent
https://projectfluent.org
Apache License 2.0
1.09k stars 98 forks source link

[Feature request] Allow serialize all AST types instead of just Resource #343

Closed wiiznokes closed 7 months ago

wiiznokes commented 9 months ago

Hello, fist able thank for this great crate, i love the fact it is so well documented.

I'm working on a desktop app to easily edit .flt files, similar to https://pontoon.mozilla.org/.

So i will need to serialize the Pattern struct, and probably other struct. Could this be part of the public API?

Also, please consider publishing a new version to crates.io seens it been 3 years seens the last release.

Thanks

alerque commented 9 months ago

You'll probably get more traction with an editor project if it was optimized for .ftl files.

But yes we should probably review what Debug/Copy/Serialize/Etc traits are available where and make sure they are available where they might be useful since that isn't something that can easily be extended externally.

wiiznokes commented 9 months ago

You'll probably get more traction with an editor project if it was optimized for .ftl files.

Yes, that what I am thinking. I don't plan to support anything other than fluent. But I will try to keep thing simple, like let the user handle complex pattern in a text box .

But yes we should probably review what Debug/Copy/Serialize/Etc traits are available where and make sure they are available where they might be useful since that isn't something that can easily be extended externally.

Hum, idk, I'm talking of the fluent_syntax crate. I just need some functions to be pub. I will try to make a pull request to show case this

wiiznokes commented 9 months ago

Sound like i will also require the api to parse only some part of the syntax. Notably the Pattern struct. Do you think it could be possible to open that ? @alerque

alerque commented 9 months ago

I don't plan to support anything other than fluent.

I was just pointing out your typo with a little humor. You could write a UI for editing Adobe Audition Filters, OpenFlight Scene Descriptions, Flight Simulator saved flights, or other formats too, but Fluent files typically have .ftl not .flt extensions.

RedMser commented 7 months ago

Isn't the API from #241 what you need? It's only available in latest master, not in crates.io. I used this API to parse, edit and serialize a .ftl file without issues.

wiiznokes commented 7 months ago

I stopped working on this, so we can close this issue

alerque commented 7 months ago

Just for the record in case anybody lands on this issue from Google: the real reason this can be closed is not because the OP stopped working on it (however true) but because it is actually now implemented. It isn't in a release get but the current Git version includes the work and the upcoming safe-harbor release (issue #347, PR #349) will have this in it. It's already pending in the changelog.