Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Localisation Plugin #461

Closed
PradeepKumarRajamanickam opened this issue Sep 9, 2020 · 11 comments
Closed

Localisation Plugin #461

PradeepKumarRajamanickam opened this issue Sep 9, 2020 · 11 comments
Labels
A-Assets Load files from disk to use for things like images, models, and sounds C-Feature A new feature, making something new possible

Comments

@PradeepKumarRajamanickam
Copy link

PradeepKumarRajamanickam commented Sep 9, 2020

It would be nice to have a localisation plugin that can set regional text, sound and images depending on the language-region preference like in unreal or godot. The localisation can be defined in a .csv (and other formats can be supported if needed). Providing localisation components can greatly enhance the user experience when setting up the scene,
eg,
If you need a ui text comp to be localised you can attach a LocaliseText component with the key to an Entity with UI Text component. The LocaliseText component system will set the UI Text component with correct string from the localisation data at runtime. Similarly we can have LocaliseSprite with sprite key to set the correct image on a sprite.

Godot Localisation
Unreal Localisation

@kellpossible
Copy link

kellpossible commented Sep 9, 2020

Localization support via https://github.com/projectfluent/fluent-rs would be good.

@erlend-sh
Copy link

Prior art: https://github.com/amethyst/amethyst/tree/master/amethyst_locale

@zbraniecki are you still involved with Fluent?

@zbraniecki
Copy link

yep. we're currently working on the next release - mostly ergonomics and higher level (locale fallbacking and resource management).

@Moxinilian Moxinilian added the C-Feature A new feature, making something new possible label Sep 9, 2020
@PradeepKumarRajamanickam
Copy link
Author

PradeepKumarRajamanickam commented Sep 9, 2020

I think I may have forgotten to mention somethings in description. We may also need to support other assets like audio, images...etc

I am going to update the description to better capture the feature set. This will enable us to better understand the scope of work that will be required to get a fully functional localisation plugin.

@zbraniecki
Copy link

hi all! The update I mentioned has been released and the current 0.13 version is quite close to what I hope to release as 1.0. It mostly covers the lower-level bits tho, and I'm now working on the higher level ergonomic wrappers.

We're also making progress on MessageFormat 2.0 which is what we hope to make a universal standard for localization format and I hope it'll be a straight superset of Fluent.

The reason I'm bringing it up is that after MF2.0, we'll start deeper exploration of standardization of bindings of localization to UI. Fluent already does it in form of Fluent DOM and Fluent React, but I expect there's a lot to explore with proper declarative bindings. And that architecture might be important for Bevy and Amethyst, much like it is fundamental for any GUI toolkit.

Here's my outline of the mental model that I'd like to propose for Bevy to think through as you decide how to integrate localization - raphlinus/crochet#7

@alice-i-cecile
Copy link
Member

See also #1459.

@alice-i-cecile alice-i-cecile added A-Accessibility A problem that prevents users with disabilities from using Bevy A-Assets Load files from disk to use for things like images, models, and sounds and removed A-Accessibility A problem that prevents users with disabilities from using Bevy labels Feb 17, 2021
@kroltan
Copy link

kroltan commented Jul 25, 2021

I like the idea of Fluent. Regarding asset localization:

I think the straightforward solution would be to use localization strings for the asset paths. This would compose neatly with the language, and also will not require any changes to the actual asset server, which means this could be implemented as a separate crate without any upstream requirements.

Another option would be to somehow enhance path resolution in the asset server, but this would mean having separate logic from string localization, which might be unnecessary complexity?

@zbraniecki
Copy link

Hi all, just an update. I recently was able to merge final refactor of Firefox Platform migration to Fluent Rust. This involves the low level bits (fluent-syntax, fluent-bundle) but also higher level (fluent-fallback and l10nregistry-rs).

This means that the stack is now production ready since, well, it's used in production in a major software :)

l10nregistry-rs is a fairly sophisticated, and severely underdocumented localization resource manager which allows Firefox Platform to do things like registering resource sources on fly (language packs), unregister etc. And fluent-fallback allows for dynamic things like live locale switching etc.

The bindings to DOM are currently in C++ and we have an equivalent in JS and bindigns to React are in JS. For Bevy, I'd recommend considering writing your own resource manager, or bundling l10n into the default asset resource manager if you have one.
But I do believe it's worth investing in clean, reactive UI bindings as I described here - raphlinus/crochet#7 - this will vastly improve DX and maintainability and open up a flock of high level features.

If you'll want to work on that, I'd be happy to review/brainstorm and ensure fluent-rs is ready.

@mockersf
Copy link
Member

there is an external plugin bevy_fluent by @kgv

@james7132
Copy link
Member

Seeing how there is a 3rd party crate for this right now. I'm closing this issue. If we ever need first-party localization support in the future, we may either include bevy_fluent or some other solution.

@igorhoogerwoord
Copy link

How do you render multiple languages with bevy_fluent?
Some languages require different fonts, it's currently not possible to use multiple fonts on a single text section.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Assets Load files from disk to use for things like images, models, and sounds C-Feature A new feature, making something new possible
Projects
None yet
Development

No branches or pull requests

10 participants