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

Some Games Require setting LC_ALL Variable for correct Language. Not possible due to stripped glibc package. #794

Closed
NightHammer1000 opened this issue Jun 6, 2022 · 87 comments

Comments

@NightHammer1000
Copy link

Some Games Require that you pass
LANG= %command%
or
LC_ALL= %command%

To launch the Game in the Correct Language. Some Games Default to English because thats the set System Language.

Doing this is not possible because the installed glibc was stripped of all its Language Files.
Which is, in my opinion, a big no-go.

Attempting to enable a locale in /etc/locale.gen and running locale-gen results in:

Generating locales...
  de_DE.UTF-8...failed to set locale!
[error] cannot open locale definition file `de_DE': No such file or directory

This can only be fixed by reinstalling glibc via pacman.

The ability to set locales should be shipped in the stock Image. There is no reason why it shouldn't.

@bertogg
Copy link

bertogg commented Jun 7, 2022

Hey, are you talking about Steam games or about games that you installed manually on the desktop? Do you have some examples?

@NightHammer1000
Copy link
Author

Patrician IV
Is one of the Games not setting the Language correctly without the possibility to set locals.

@bertogg
Copy link

bertogg commented Jun 7, 2022

What version of this game are you running? The one from Steam fails with Error in 'App::Initialize'.

Edit: never mind, it worked on the third attempt

@bertogg
Copy link

bertogg commented Jun 7, 2022

From the Steam UI it certainly does ignore the language setting, how are you launching it to make it work in German?

@NightHammer1000
Copy link
Author

LC_ALL=de_DE.UTF-8 %command% does the trick for me.
You need to delete the Wine Prefix tho, because once the config file is created there is no way to change it again without editing the Config File.

@NightHammer1000
Copy link
Author

Another Example is a Non-Steam one.
Bioshock Remastered from the Epic Store Launched through Heroic.
This Game also requires that you pass LC_ALL=de_DE.UTF-8 to it.

@TTimo
Copy link
Collaborator

TTimo commented Jun 7, 2022

I note that even on systems that have a glibc install supporting all locales, these title still require manual workarounds to enable specific languages.

@bertogg
Copy link

bertogg commented Jun 8, 2022

In the case of Patrician IV setting the language from English to German downloads the German version of the game (>2GB) with all voices in German, but all messages on the screen, menus, etc, are still in English.

@bertogg
Copy link

bertogg commented Jun 9, 2022

The language of the messages is defined in c:/users/steamuser/Application Data/Kalypso Media/Patrician 4/options.cfg

If you install the German version of the game and never run the English version before then everything works as expected.

The problem happens if you run the English version first and then switch to the German version. I would say that's a bug, and it can be worked around by removing (or editing) options.cfg after switching versions.

None of this requires changes to the available glibc locales as far as I can tell.

@NightHammer1000
Copy link
Author

Still. Is there an explicit Reason why all the Language files should be stripped?
Why not give the users the Possibility to run the Desktop and Non-Steam Games in their own language?
The fact that the Language Files are stripped out is something I don't get. Even the smallest Live-CD Distros like GParted and DamnSmallLinux are supplying those files.

@TTimo
Copy link
Collaborator

TTimo commented Jun 9, 2022

Why not give the users the Possibility to run the Desktop and Non-Steam Games in their own language?

We believe this is possible already, and does not require the extra libc locale files. @bertogg has concluded that Pratician IV failing to switch to German is a game bug. Those typically need to be taken up with the game developer.

We aggressively reduce the size of the OS partition by removing locales, man pages, etc. This is done to leave as much space as possible for game content. We understand this is not ideal for a desktop use case.

Some of these decisions on what to include/exclude may change in the future, but in this particular case we do not see this being justified yet.

@NightHammer1000
Copy link
Author

NightHammer1000 commented Jun 10, 2022

The Game was one example fixable with other means.
Games like Bioshock Remasterd from the Epic Store through Herioc is one example that is not fixable otherwise.

But that issue goes even further than games.
I know of at least 2 German Steam Deck users that sold their devices because Desktop Mode was unusable for them because their English is not good enough. Not every single person knows english.
I do believe this is a Point you guys should really think about when selling Internationally. If you do not ship them, at least provide a Script that can pull those files from a Server.

@bertogg
Copy link

bertogg commented Jun 10, 2022

I think there are two things here:

  • Whether having all locales generated is necessary to run a particular game in a particular language. That I would be interested to know in order to see what's actually happening under the hood and how we can solve it. In the Patrician IV case that doesn't seem to be the problem and in principle I would expect that you can change any game's language without having to change the locale.

  • Whether the OS should support running the desktop with any arbitrary locale and language. Here there are more considerations, one of them (not the only one) is that we would need all translation files for all packages, in my computer that's more than half a GB worth of files in the root filesystem.

@xrishox
Copy link

xrishox commented Aug 24, 2022

a large portion of visual novels depend on japanese locale to be able to run. not having japanese locale in steamos is cutting out a large portion of an entire genre of game from running. these are non-steam games, but all the same it would be really great to be able to run them. please consider adding japanese locale for visual novel support.

there are a number of examples of people trying to attempt this and running into issues that require them to unlock steamos and hoping for the best.

https://old.reddit.com/r/SteamDeck/comments/u77i9m/steam_deck_japanese_visual_novels_how_change/
https://old.reddit.com/r/SteamDeck/comments/wc14gg/enable_japanese_locale_on_steam_deck/
https://old.reddit.com/r/SteamDeck/comments/v5jcbo/guide_to_changing_locale_settings_for_japanese/
https://old.reddit.com/r/SteamDeck/comments/v8375c/how_does_proton_handle_locale_emulation/

a guide on youtube someone made about unlocking the steam deck to be able to play vns on the steam deck:
https://www.youtube.com/watch?v=KtiA6GaFIzM&t=3s

@TTimo
Copy link
Collaborator

TTimo commented Aug 24, 2022

Non-steam game or not, running these in a sniper SLR would be the better way forward in order to avoid switching the root OS to read/write. We are working on improving locale support but that has a lot of ramifications, no ETA.

@cfillion
Copy link

cfillion commented Aug 25, 2022

The Japanese locale can be enabled on the Deck without unlocking SteamOS. If the game's files only have ASCII characters: using HOST_LC_ALL=ja_JP.UTF-8 %command% as launch options does the trick of setting Proton's codepage (the locale doesn't have to actually exist on the system in this case).

For games that both require the Japanese locale in Proton + have Japanese filenames: ja_JP.UTF-8 locale files can be created on a full Linux install then copied to the Deck's user directory + using a custom launch script to overwrite LOCPATH after the Steam Runtime resets it.

(And for games that use non-English filenames but don't require changing Proton's locale: just LANG=en_US.utf8 %command% is enough. utf8 instead of UTF-8. SteamOS bug? It also affects apps running in desktop mode.)

Non-root solution at https://gist.github.com/cfillion/4394c3b8cd051fb45721187053e92296.

@bertogg
Copy link

bertogg commented Sep 5, 2022

I'm not from Valve and I don't decide what locales to support, I was just trying to understand the problem and give some technical context, but anyway:

I feel it is sickening that we even have to have this kind of conversation, just because some narrow minded English only speaking decision makers are a) either totally oblivious or ignorant
[...]
This is not true. And, you know it.

This is unnecessary.

Linux distros including SteamOS can be configured to a set of supported locales (see /etc/locale.gen and locale-gen). Hence, there is a mechanism to download or install only needed locales.

There are two things: compiling the locale definitions and actually having the translations installed. The translations are what takes most of the disk space and they come with each individual package. Also, note that the root filesystem is read-only.

@NightHammer1000
Copy link
Author

We can argue all day here. The fact is that SteamOS currently Gatekeeps the Desktop Mode and certain Games to English Speakers only, only to save a few Megabytes really not worth saving if it means that half of the Device is not usable at all to non Native English speakers.
Unnecessary in my eyes. I don't understand why this is a point of discussion at all. It should be a given to support all Translations if you sell worldwide. ESPECIALLY if all the Translations already exist.

@NightHammer1000
Copy link
Author

NightHammer1000 commented Sep 7, 2022

I am currently thinking about forking HoloISO and modifying it from its hardware universal approach back to a Steam Deck-specific Image. Just to give the users the Option to something Valve is unwilling to give. Their Native Language and an open file system.

Like I said. I know a few people, mostly german, who were really excited about the prospect of a Portable PC with full Desktop access but canceled their order once they got to know that Desktop was English only.

Due to the changes to the kernel not being upstreamed, we currently have only two real options. SteamOS with very Lacking International functionality, and Windows, which Drivers lack important functionality like DXVA2 while also having massive Installing Problems. (Bluescreen with no Boot after APU Driver install)

Trying to run a different Distro on the Deck will give you a headache.

So, our best chance currently is to build the solution we want ourselves from the Image we already have. Because I don't see something changing here anytime soon, to be honest.

@xrishox
Copy link

xrishox commented Sep 7, 2022

they have already acknowledged the problem and said they plan to address it. i don't know why you are acting like this is not the case. it will get done when it gets done. this is not the place to have a passive aggressive and disrespectful back and forth about it. it won't get it fixed any faster.

in the mean time, unlike any other console that is currently produced, you can unlock root and fix it yourself until it gets pushed out officially if it is a serious problem for you.

@nisehime
Copy link

Steam Deck just launced in Asia and guess what? The desktop mode is STILL in English only. Also, it looks like some games (on Unity?) cannot display japanese language, for example RimWorld and Valheim, due to missing fonts I suppose. They both have "Verified" mark btw.

@NightHammer1000
Copy link
Author

Seems like user Experience still isn't a huge priority

@StoneMoe
Copy link

locale missing introduced a lot troubles for me and spends me almost a week to address them.

There is multiple solutions imo:

  1. Valve delete built-in desktop wallpapers to save disk space for pre-installed locale files
  2. Valve add new SteamOS-offload mount to make locale-gen works
  3. User use overlayfs to make locale-gen works (e.g. rwfus)

@NightHammer1000
Copy link
Author

Another Example for Software that does not work in other Languages is the Emulator PPSSPP in Flatpak form because Flatpak does not download the Locals if it's not set.
So, you are unable to set the Language of the Emulated PSP, and it always defaults to English in all Games you Launch with it.

@StoneMoe
Copy link

StoneMoe commented Jan 5, 2023

Another Example for Software that does not work in other Languages is the Emulator PPSSPP in Flatpak form because Flatpak does not download the Locals if it's not set. So, you are unable to set the Language of the Emulated PSP, and it always defaults to English in all Games you Launch with it.

This can be workaround by:

flatpak config --set language "en;jp;fr" # change language code here, add --user if your flatpaked app is installed as user app
flatpak update  # flatpak will download locales you set

@NightHammer1000
Copy link
Author

Thanks.
Man.
Steam Deck outside the English Language really turns into a workaround machine.

@xrishox
Copy link

xrishox commented Jan 7, 2023

flatpak config --set language "en;jp;fr" # change language code here, add --user if your flatpaked app is installed as user app
flatpak update # flatpak will download locales you set

does this work even without steamos itself having japanese locale enabled?

@NightHammer1000
Copy link
Author

Great. Desktop finally is usable and all the old games finally start in the right language.

Thank you.

@rKsanu2MMYvypWePtQWM
Copy link

It seems very weird that not all European Union countries are supported in this change (at least from the list above). It seems weird that Valve didn't add support for the countries the Deck is being sold at.

@germanicianus
Copy link

germanicianus commented Jun 3, 2023

Just for the record - see #816 (comment) why supporting multiple locales is important for Valve's revenue (from my understanding).

@bertogg, many thanks for highlighting in #794 (comment) that Flatpak has an independent language setting but defaults to the system language.

With main you mean the preview update channel which is built from the master branch, right?

@bertogg
Copy link

bertogg commented Jun 3, 2023

With main you mean the preview update channel which is built from the master branch, right?

I mean the preview channel, yes.

@bertogg
Copy link

bertogg commented Sep 18, 2023

This is now available in SteamOS 3.5 preview (OS build 20230915.100)

@superboo07
Copy link

Updating the flatpak langauge no longer makes that language accessible for programs in the preview branch

@bertogg
Copy link

bertogg commented Sep 25, 2023

@superboo07 do you have an example of a Flatpak app where you cannot set the language?

@bertogg
Copy link

bertogg commented Sep 26, 2023

Let's do a recap on how to change the language settings in Flatpak in SteamOS 3.5.


CASE 1: you want to change the language for the desktop and for all Flatpak apps.

  • Go to the KDE Plasma Settings -> Personalization -> Regional Settings.
  • Change the language.
  • Restart the session.

After this, open a terminal and run sudo flatpak update, this will download the Flatpak locales for the new language. You only need to do this once. All apps that you install from now on will come with the selected language pack (if they support it).

This should be enough, all desktop and Flatpak apps will run using the locale that you have selected.


CASE 2: you want to run a Flatpak app with a locale different from the system one.

  • Add the additional locales that you want to have supported in Flatpak:
$ sudo flatpak config --set extra-languages "de;es;fr"
$ sudo flatpak update
  • Set the default locale for a certain Flatpak app:
$ flatpak override --env=LANG=de_DE.UTF-8 org.ppsspp.PPSSPP
  • Set a default locale for all Flatpak apps:
$ flatpak override --env=LANG=de_DE.UTF-8

NOTES

Even if you select a certain locale when you run an app that doesn't mean that the app is going to show the messages in that language. It's up to the app to decide whether to show the messages based on the current locale or based on some other criteria.

Example: PPSSPP uses the language that is defined in the configuration file, ~/.var/app/org.ppsspp.PPSSPP/config/ppsspp/PSP/SYSTEM/ppsspp.ini

  • If that file does not exist (i.e. when you run PPSSPP for the first time) then the language will be taken from the current locale.
  • After that changing the locale will not change the PPSSPP language settings. You need to do it from PPSSPP itself (Settings -> System -> Language) or you can also remove the ppsspp.ini file and have it recreated the next time you start the emulator.

@superboo07
Copy link

@superboo07 do you have an example of a Flatpak app where you cannot set the language?

Lutris, it used to work in a past update where adding the locale would allow setting prefixes made in it to use that locale. Now the locales don't show up at all

@xrishox
Copy link

xrishox commented Oct 2, 2023

you can manually set environment variables in lutris on a per app basis. it definitely works as i have done it personally.

@superboo07
Copy link

you can manually set environment variables in lutris on a per app basis. it definitely works as i have done it personally.

it can't use japanese locale without it being installed in flatpak, which used to work in the past but doesn't anymore.

@superboo07
Copy link

Still desperate for a fix, tried running the below command to check if it had installed the locale

flatpak run --command=sh net.lutris.Lutris -c 'locale -a' 

Output revealed that it indeed hadn't, and I don't know where to go from here since I have added the japanese locale to my extra languages in flatpak

@superboo07
Copy link

I have at this point attempted everything I can, the only thing I can reasonably conclude is that something has been been broken between the switch from 3.4 to 3.5. A fix would be much enjoyed as this issue stops a multitude of software that would've once ran near perfectly from running at all.

@xrishox
Copy link

xrishox commented Oct 5, 2023

once again it definitely does work. i'm on steamos 3.5 right now playing japanese games with japanese locale in lutris.

@superboo07
Copy link

Could you post the output you recieve apon using the below command then please

flatpak run --command=sh net.lutris.Lutris -c 'locale -a' 

@xrishox
Copy link

xrishox commented Oct 5, 2023

(deck@steamdeck ~)$ flatpak run --command=sh net.lutris.Lutris -c 'locale -a'
C
C.utf8
en_AG
en_AU
en_AU.utf8
en_BW
en_BW.utf8
en_CA
en_CA.utf8
en_DK
en_DK.utf8
en_GB
en_GB.utf8
en_HK
en_HK.utf8
en_IE
en_IE@euro
en_IE.utf8
en_IL
en_IN
en_NG
en_NZ
en_NZ.utf8
en_PH
en_PH.utf8
en_SG
en_SG.utf8
en_US
en_US.utf8
en_ZA
en_ZA.utf8
en_ZM
en_ZW
en_ZW.utf8
ja_JP.eucjp
ja_JP.utf8
POSIX

@superboo07
Copy link

What are the steps you took to install the japanese locale, I used the ones that were given above in this thread but they didn't work on 3.5

@xrishox
Copy link

xrishox commented Oct 5, 2023

It's been a long time since i did it so i don't remember exactly. that said I use linux outside of the steam deck and these are the usual flatpak locale commands i run:

flatpak config --set extra-languages ja_JP.UTF-8

flatpak config --user --set languages "en;jp;ja"

flatpak update

i'm sure that those commands are some combination of incorrect or redundant, but they have worked for me on my linux installs. someone else can probably fix them to make them how they should be. then inside of lutris or bottles i don't use the built in locale dropdowns i manually set the environment variables in the settings on a prefix by prefix basis.

environment variables i use:

LC_ALL="ja_JP.UTF-8" 
TZ="Asia/Tokyo"

for what it's worth i didn't run any commands at all after upgrading to 3.5 because it never stopped working from before.

@bertogg
Copy link

bertogg commented Oct 5, 2023

@superboo07

What are the steps you took to install the japanese locale, I used the ones that were given above in this thread but they didn't work on 3.5

# Check the existing configuration
$ flatpak config
languages: *unset* (default: en)
extra-languages: *unset*

# Add the Japanese locale
$ sudo flatpak config --set extra-languages "ja"

# Check the updated configuration
$ flatpak config
languages: *unset* (default: en;ja)
extra-languages: ja

# Download the localization files
$ sudo flatpak update

@superboo07
Copy link

superboo07 commented Oct 5, 2023

Replying to #794 (comment)

these are the exact steps I took. I suppose there is a chance my install was bugged though.

@superboo07
Copy link

superboo07 commented Oct 5, 2023

Replying to #794 (comment)

Maybe it keeps locales installed before 3.5, I suppose you could check if it'll install the german locales to lutris since it won't hurt to test. Though I'm thinking my 3.5 install might've been bugged

@bertogg
Copy link

bertogg commented Oct 9, 2023

these are the exact steps I took. I suppose there is a chance my install was bugged though.

Can you send me the output of these two commands?

$ flatpak config

$ flatpak run --command=sh net.lutris.Lutris -c 'locale -a'

@superboo07
Copy link

superboo07 commented Oct 13, 2023

these are the exact steps I took. I suppose there is a chance my install was bugged though.

Can you send me the output of these two commands?

$ flatpak config

$ flatpak run --command=sh net.lutris.Lutris -c 'locale -a'

When I was on 3.5 The output for flatpak config is:

languages: *unset* (default: en)
extra-languages: ja

The output for checking the flatpak locale is:

C
C.utf8
en_AG
en_AU
en_AU.utf8
en_BW
en_BW.utf8
en_CA
en_CA.utf8
en_DK
en_DK.utf8
en_GB
en_GB.utf8
en_HK
en_HK.utf8
en_IE
en_IE@euro
en_IE.utf8
en_IL
en_IN
en_NG
en_NZ
en_NZ.utf8
en_PH
en_PH.utf8
en_SG
en_SG.utf8
en_US
en_US.utf8
en_ZA
en_ZA.utf8
en_ZM
en_ZW
en_ZW.utf8
POSIX

@superboo07
Copy link

superboo07 commented Oct 13, 2023

Replying to #794 (comment)

I had tried sudo in the past, it didn't make a difference in making it install the jp locale. The only thing it changed was how it asked for my sudo password, if I didn't specify sudo it would bring up a dialog box with a test input for me to put it in.

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