Is there any project that implements this in C#?
CarePackage17 opened this issue · comments
I have looked on google but found nothing. It would be really nice to have this in C#/.NET Standard projects as it would allow usage in Mono/Unity3D and many other CLR implementations.
It would also be useful to have this implemented in Java as well.
Also, no, it’s currently only implemented in Rust, JavaScript and Python, but C# can import native libraries (i.e. fluent-rs) much more easily than Java, although Mozilla has documented how to add Rust dependencies to Java code.
I'd love to see a C# implementation of Fluent! In particular I think it would be great to be able to use it from within Unity3D. Fluent is a great match for gamedev and in fact some of the features and discussions have been inspired and motivated by it (e.g. #80).
The primary driver for Fluent's development has been Firefox and we've only focused on the implementations which are required in order to migrate Firefox to Fluent. I expect that this will continue to be the case at least for the next 3-6 months. I can't commit to creating the C# implementation myself but I'd love to see it as a community contribution.
We're getting very close to Fluent 1.0. The roadmap puts it at the end of June. Once it's published it will make a great base for more implementations.
I'm aware of at least one effort by @GlenDC to create a C# implementation of L20n. It stared as https://github.com/GlenDC/L10n.cs which now appears to have moved to https://github.com/polylingo/l20n.cs. See the Unity thread for more information. Glen also wrote an insightful article about localization in gamdev which is a great read.
L20n was Fluent's predecessor and is now deprecated, but its ideas live on in Fluent. The syntax has changed, however, so the implementation would have to be updated (preferably after Fluent 1.0 is published).
Yes, back when Fluent was still called L20n, I was working on a C# Library. Well I think it was a bit misfortune as the spec was just about to change heavily or in the midst of changing while I was working on the first version. The second version was much faster.
What I've learned from that experience that it wouldn't take that much effort from even a single developer to provide a C# library that would allow one to use Fluent in any C#-enabled project. However, as I did this, I learned that this is really not enough at all in order to convince Game Companies, especially bigger ones, to use it. Even if it were for free.
What you would definitely also need for Unity projects to provide the library as a nice plugin with a GUI that provides optimal UX. I provides some unity GUI as a plugin, but never got too far with it. As I really lacked the experience to implement the best possible GUI and the lack of motivation to learn more in order to do so (as developing editor plugins for Unity is a pretty frustrating experience imho).
So providing a C# library is easy, providing a Unity plugin will be roughly the same amount of effort, depending on your unity experience. However, that still doesn't make it useable for most game companies. Most game companies don't have an internal localization team, certainly not for all regions/languages. Instead they outsource this work to other companies. The standard here is spreadsheets where the translators have to translate column A into column B, as to speak. If they're lucky they get some context as comments, screenshots or even videos.
In my opinion Fluent is all about empowering the translators. However, expecting them to write code-like files with all the power that fluent brings in it raw form, is probably asking too much. I'm sure some are willing to learn it, but I doubt this ever becomes a normal thing. Therefore what you really need is a fluent editor, not aimed at the web, but aimed at any project that uses fluent.
For such an editor you would want live previews of translations, smart text-boxes where the translator can type texts and with shortcuts and/or mouse handling drag in text-embedded widgets to allow for the dynamic translation features Fluent brings. As an example.
Once you have such an awesome tool, you would have to somehow convince translation companies of using them (unless you want to on top of that also provide your own online market, with your tool embedded/central, where you match translators with companies in need of translators). Because only once translators are able to provide fluent-enabled translations, will your C# library and Unity plugin be useful. Same for the Rust plugin, which could easily be used as the core for an Unreal plugin.
I tried, but couldn't find the right collaborator to join me in such a long journey. The truth is that most game companies I talked to really don't see the value in this, and even if they do see they value (must of them really don't and consider localization as an after-thought), they would still need to provide spreadsheets to translators, and so it would still boil down to simple key-value translations. And if that's the case, there are already plenty of Unity plugins that provide this and have the sales and ratings behind them to back them up.
That being said, I do still am in love with Fluent, and should I work for Mozilla, it would be the project I would want to be involved in. That and Rust.
It would also be useful to have this implemented in Java as well.
We talked a bit about this recently, and our initial take was to consider Kotlin rather than Java. Do you have an opinion on Kotlin as a target?
Talking about the l20n library I made back when dinosaurs still roamed the Earth. should someone want to make a proper Fluent C# library, feel free to copy the code/project at https://github.com/polylingo/l20n.cs as a basis/starting-point. It was functional and feature-complete for L20n AFAIK. So if you want to turn it into a Fluent library, it should be pretty do-able. Would be nice if you could credit me somewhere though, if you do.
It would also be useful to have this implemented in Java as well.
We talked a bit about this recently, and our initial take was to consider Kotlin rather than Java. Do you have an opinion on Kotlin as a target?
Well, Kotlin runs on the JVM, so it should be rather compatible with Java, although it might possibly need a few helper classes, similar to when dealing with Java ⇔ Scala calls. Granted, the need for those has significantly lessened since Java 8 and Scala 2.12.
Update: I have now opened issue #158 to track a JVM implementation.
I just learned about https://github.com/blushingpenguin/Fluent.Net by @blushingpenguin. It looks promising!
I'm going to close this issue since the answer is now: yes :) I opened a few issues in Fluent.Net
but I haven't yet had time to take a deeper look at the code. @blushingpenguin, feel free to ping me if you have any questions or if you run into any troubles.
Hi, I did publish a lib for Fluent called Linguini, https://github.com/Ygg01/Linguini
It's not perfect but I think it is a faithful port of fluent.rs