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

Client-side translation #17

Open
rubenwardy opened this issue Jun 30, 2022 · 4 comments
Open

Client-side translation #17

rubenwardy opened this issue Jun 30, 2022 · 4 comments

Comments

@rubenwardy
Copy link

You currently use intllib, which forces all users to use the same language

I recommend using Minetest's built-in support for translation instead. I wrote a tutorial here: https://rubenwardy.com/minetest_modding_book/en/quality/translations.html

@zeuner
Copy link
Owner

zeuner commented Jul 2, 2022

Switching to minetest.translate is already on my 2022 agenda because it removes a dependency. However, I'm not sure yet whether the translations will be done client-side, or through minetest.get_translated_string. Among the requested functionality I have to consider is the possibility to switch the language while logged in, which seems to be unsupported by Minetest. All accessors for the client language I know of (server-side minetest.get_player_information or client-side minetest.get_language) are read-only. So I might have to use only parts of Minetest's translation API for now.

@rubenwardy
Copy link
Author

rubenwardy commented Jul 2, 2022

What's the reason for switching language whilst logged in? Is this an actual request you received? I ask because I'm wondering whether it's because they just couldn't find the language setting. I'm working on a settings GUI redesign which will make it more prominent

Implementing language switching yourself is dubious, only your mod will change language - not other mods or the engine

@zeuner
Copy link
Owner

zeuner commented Jul 29, 2022

Yes, the request is to have a language setting right in the EDUtest UI (thus, in-game). To be sure, I pointed out the existing language setting using a screenshot. A downside of it might be that it requires restarting Minetest (https://github.com/minetest/minetest/blob/master/src/settings_translation_file.cpp#L194).

I agree that a mod-specific language switcher should be avoided if possible. Should I have to implement it, I might look into writing a Minetest PR for a language switching API, for which the mod-specific switcher could become a frontend later on.

@zeuner
Copy link
Owner

zeuner commented Mar 8, 2023

In the edutest-2022 branch I have translation support using Minetest's own API. I need to compute most translations server-side (minetest.get_translated_string), though, because I need to estimate their rendered size for the layout. Improving this would require a possibility to compute formspec layouts client-side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants