Closed FKanzler closed 5 months ago
I had the same issue. A few things here.
First of all, for some reason, the method "new_concurrent" is inside of "fluent_bundle::bundle::FluentBundle", but not "fluent_bundle::FluentBundle". This should probably be updated.
Also, the IntlLangMemoizer is not exported from fluent_bundle either.
I downloaded the repo and added it as a local dependency, then inside of fluent_bundle/src/concurrent.rs, I switched the line:
use intl_memoizer::{concurrent::IntlLangMemoizer, Memoizable};
for
pub use intl_memoizer::{concurrent::IntlLangMemoizer, Memoizable};
.
It works now.
This should probably be updated in the main repo.
I haven't looked into it too much, but it seems like "fluent-templates" might be using new_concurrent under the hood, and the best practice would be to use that. Not too sure about this. Might be worth a look.
The work here is to re-export the new_concurrent
as suggested above. The IntlLangMemoizer is covered by #256.
@gregtatum From what I understand the problem comes from here where we redefine FluentBundle
as
pub type FluentBundle<R> = bundle::FluentBundle<R, intl_memoizer::IntlLangMemoizer>
thus prohibiting any use of the new_concurrent
function with a use fluent_bundle::{FluentBundle}
import.
A simple solution can be to create the following type
pub type FluentBundleConcurrent<R> = concurrent::FluentBundle<R, concurrent::IntlLangMemoizer>;
to allow use fluent_bundle::{FluentBundleConcurrent}
. What are your thoughts on this?
As far as I understand, this is and was fixed already. There is a comment in #300 about a regression, but looking at the code right now I don't see it. You should be able to use concurrent::FluentBundle
for your type and FluentBundle::new_concurrent()
as a constructor.
If I'm missing something and this is not actually viable, please by all means do comment back here and I'll re-open and re-evaluate what is going on.
Hello,
unfortunately I am not able to figure out how to access the concurrent specialization of FluentBundle.
In the documentation it says:
Simplified code:
Compiler error:
Is there something I'm missing here? How could this be made to work?