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

Make strings for the current language and language switching available on Rust side #23

Open
Raphiiko opened this issue May 2, 2023 · 2 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@Raphiiko
Copy link
Owner

Raphiiko commented May 2, 2023

Currently, the Rust side cannot access any translations. These are only available in the frontend.

Ideally, the frontend should send the translations to the Rust side on startup, as well as whenever the language is changed.

The Rust side should be able to update its shown translations (e.g. for the system tray from #22) whenever the active language is updated.

@Raphiiko Raphiiko changed the title Make current language and language switching available on Rust side Make strings for the current language and language switching available on Rust side May 2, 2023
@Raphiiko Raphiiko added enhancement New feature or request good first issue Good for newcomers labels May 2, 2023
@Raphiiko Raphiiko mentioned this issue May 2, 2023
@SticksDev
Copy link

Maybe this is best suited for a tauri command?

see https://tauri.app/v1/guides/features/command

could just have a command that tells rust what lang to use and go from there

@Raphiiko
Copy link
Owner Author

Oh yeah it very much is. How to get things from/to the Rust side isn't really an issue.
OyasumiVR already makes heavy use of Tauri commands (and events). Barely anything it does would be possible without any native functionality written in Rust.

The complexity comes more from how to structure this in a sane and generic way: You ideally only want to have a single source of translations, have the ability to update everything on the fly while keeping things in sync, and have it be a solution that is generic enough that it can be reused for various (future) translations, e.g. not just the system tray.

It's likely not rocket science, but it's mostly a nice to have, and for me personally, the gain of looking into it currently isn't worth the time that I could spend on improving OyasumiVR elsewhere.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants