ValveSoftware / steam-runtime

A runtime environment for Steam applications
Other
1.17k stars 86 forks source link

Among Us (945360) can't input Japanese, needs ja_JP.UTF-8 locale support. #626

Closed zzhiyi closed 8 months ago

zzhiyi commented 9 months ago

Your system information

Please describe your issue in as much detail as possible:

Among Us (945360) can't input Japanese. The same bug can be reproduced with Wine on Ubuntu 23.04 if ja_JP.UTF-8 is not enabled. If I run sudo dpkg-reconfigure locales and enable ja_JP.UTF-8, then the bug is fixed. So I think Sniper is missing ja_JP.UTF-8. We should probably enable all other locales. Proton 7.0-6 uses soldier and doesn't have this problem.

Steps for reproducing this issue:

  1. Install system font and input method for Japanese (Kana)
  2. Add this to launch options for Among Us: LC_ALL=ja_JP.UTF-8 LANG=ja_JP.UTF-8 LANGUAGE=ja_JP.UTF-8 %command%
  3. Launch Among Us
  4. Go to My Account -> Account -> Change name. Delete the name and then try to type in a Japanese font.

Expected result: Japanese characters get typed. Actual result: Nothing is displayed.

smcv commented 9 months ago

I think Sniper is missing ja_JP.UTF-8. We should probably enable all other locales.

We intentionally don't do that, because locales-all is more than 200M, so installing locales-all in the runtime would add about 30% to its size (for all users, with any language settings).

Instead, the container runtime framework tries to import your enabled locales from the host system. soldier and sniper are the same here - they use all the same mechanisms, the only difference is that sniper uses libraries from a version of Debian that is 2 years newer than the one used for soldier.

Please collect a log from launching Among Us under Proton 8 and sniper, so that we can see why this is not working, by running it with:

STEAM_LINUX_RUNTIME_VERBOSE=1 STEAM_LINUX_RUNTIME_LOG=1 LC_ALL=ja_JP.UTF-8 LANG=ja_JP.UTF-8 LANGUAGE=ja_JP.UTF-8 %command%

The log will appear in steamapps/common/SteamLinuxRuntime_sniper/var/. slr-latest.log will be created as a symbolic link to the actual file.

Because you say Proton 7 is working as you expect, it would also be useful to see a log with the same settings, but choosing to run Among Us with Proton 7 and soldier, so we can compare. This time the log should appear in steamapps/common/SteamLinuxRuntime_soldier/var/.

zzhiyi commented 9 months ago

Thanks for the quick response. Here are the logs. Unfortunately, I don't see anything wrong with them. The host system has ja_JP.UTF-8 enabled by the way.

sniper-slr-app945360-t20231011T100634.log soldier-slr-app945360-t20231011T100735.log

smcv commented 9 months ago

Both containers should have the host system's locale files available:

10:06:34.398107: pressure-vessel-wrap[3201906]: D: Making provider locale data visible in container
10:06:34.398123: pressure-vessel-wrap[3201906]: D: Removing "${container}//usr/lib/locale"
10:06:34.398196: pressure-vessel-wrap[3201906]: D: Creating symlink "${container}//usr/lib/locale" -> "/run/host/usr/lib/locale"
10:06:34.398217: pressure-vessel-wrap[3201906]: D: Removing "${container}//usr/share/i18n"
10:06:34.399658: pressure-vessel-wrap[3201906]: D: Creating symlink "${container}//usr/share/i18n" -> "/run/host/usr/share/i18n"

and the pressure-vessel-locale-gen tool doesn't generate any new ones:

10:06:34.458952: pressure-vessel-adverb[3202003]: D: Making sure locales are available
10:06:34.469719: pressure-vessel-adverb[3202003]: D: Diagnostic output:
pressure-vessel-locale-gen: No locales need to be generated

10:06:34.469757: pressure-vessel-adverb[3202003]: I: No locales have been generated
10:06:34.469808: pressure-vessel-adverb[3202003]: I: No locales were missing

which should mean that pressure-vessel-try-setlocale has successfully called setlocale() for each of your locales (LC_ALL and LANG among others).

zzhiyi commented 8 months ago

Thanks. I looked into this further and found out that the Steam Linux Runtime is actually functioning correctly. The problem lies in the https://github.com/ValveSoftware/Proton/blob/proton_8.0/proton script that resets LC_ALL by default. And HOST_LC_ALL should be used instead to override the LC_ALL settings. https://gist.github.com/cfillion/4394c3b8cd051fb45721187053e92296 has explained this problem pretty well. The reason why LC_ALL=ja_JP.UTF-8 works in Proton 7.0 is probably some kind of accident.