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

Language blacklist does not exclude translations on Android #13808

Closed
rollerozxa opened this issue Sep 14, 2023 · 2 comments · Fixed by #13865
Closed

Language blacklist does not exclude translations on Android #13808

rollerozxa opened this issue Sep 14, 2023 · 2 comments · Fixed by #13865
Labels
Bug Issues that were confirmed to be a bug @ Translation
Milestone

Comments

@rollerozxa
Copy link
Member

Minetest version

5.8.0-dev (I believe the issue still exists and can be reproducible in Minetest master)

Active renderer

No response

Irrlicht device

No response

Operating system and version

Android

CPU model

No response

GPU model

No response

OpenGL version

No response

Summary

The language blacklist that is used on desktop to exclude translations for RTL languages that don't show up text does not apply to Android, as translations are generated and copied by Gradle rather than CMake.

Now that Android detects the system's locale as of recent, if the device has a RTL language it will select the language and load the translation for the broken RTL language, leading to all translated text showing up as empty on startup. The person who reported this bug to me attached the following screenshot:

empty

Steps to reproduce

  1. Set your system locale on Android to one that is RTL
  2. Set minetest to the "(Use system language)" language option (the default)
  3. No text!
@rollerozxa rollerozxa added the Unconfirmed bug Bug report that has not been confirmed to exist/be reproducible label Sep 14, 2023
@rubenwardy rubenwardy added this to the 5.8.0 milestone Sep 14, 2023
@sfan5 sfan5 added Bug Issues that were confirmed to be a bug and removed Unconfirmed bug Bug report that has not been confirmed to exist/be reproducible labels Sep 16, 2023
@sfan5
Copy link
Member

sfan5 commented Sep 17, 2023

While Android uses cmake it does not use the install scripts, so translations are compiled by gradle:

// compile translations
fileTree("${projRoot}/po").include("**/*.po").forEach { poFile ->
def moPath = "${assetsFolder}/locale/${poFile.parentFile.name}/LC_MESSAGES/"
file(moPath).mkdirs()
exec {
commandLine 'msgfmt', '-o', "${moPath}/minetest.mo", poFile
}
}

I don't know if it's easily possible to defer this to cmake.

@srifqi
Copy link
Member

srifqi commented Sep 18, 2023

This is caused by Minetest not checking whether the system language (or the selected language) is in the language blocklist or not. Minetest just relies on CMake to not compile the translation.

Creating the same list in src/gettext.cpp might help. To make the APK smaller, we can also add the filter in android/app/build.gradle.

This issue happens in Windows (10.0.19045), too. I tested it by setting the system language into Hindi (hi).

Minetest using Hindi localisation showing the singleplayer tab Minetest using Hindi localisation showing the setting dialog

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Issues that were confirmed to be a bug @ Translation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants