Difference between revisions of "Locales"

From Linux Gaming
Jump to navigation Jump to search
(Created page with "Some games might require to have different [https://en.wikipedia.org/wiki/Locale_(computer_software) locales] enabled on your system. == Generating locales == Before enabling locales, you must generate them first. To do that, uncomment the lines with the locales you want to enable in <code>/etc/locale.gen</code> and run <code>sudo locale-gen</code> inside a terminal emulator. For example, many fan-translated Japanese games require a Japanese locale. To generate it, jus...")
 
m (Add references)
 
Line 2: Line 2:


== Generating locales ==
== Generating locales ==
Before enabling locales, you must generate them first. To do that, uncomment the lines with the locales you want to enable in <code>/etc/locale.gen</code> and run <code>sudo locale-gen</code> inside a terminal emulator.
Before enabling locales, you must generate them first. To do that, uncomment the lines with the locales you want to enable in <code>/etc/locale.gen</code> and run <code>sudo locale-gen</code> inside a terminal emulator. Then, you can list all enabled locales with <code>locale --all-locales</code><ref>https://wiki.archlinux.org/title/Locale#Generating_locales</ref>.


For example, many fan-translated Japanese games require a Japanese locale. To generate it, just uncomment <code>ja_JP.UTF-8 UTF-8</code> in <code>/etc/locale.gen</code> and run the command above. Most games should work with that locale but you might have to uncomment <code>ja_JP.SJIS SHIFT_JIS</code> or <code>ja_JP.EUC-JP EUC-JP</code> too and regenerate locales.
For example, many fan-translated Japanese games require a Japanese locale. To generate it, just uncomment <code>ja_JP.UTF-8 UTF-8</code> in <code>/etc/locale.gen</code> and run the command above. Most games should work with that locale but you might have to uncomment <code>ja_JP.SJIS SHIFT_JIS</code> or <code>ja_JP.EUC-JP EUC-JP</code> too and regenerate locales<ref>https://forum.winehq.org/viewtopic.php?t=28978</ref>.
 
Then, you can list all enabled locales with <code>locale --all-locales</code>.


== Setting the locale ==
== Setting the locale ==
To set the locale, the easiest way to do it is through environment variables. This way, it will only affect the game or program you want to run.  
To set the locale, the easiest way to do it is through environment variables. This way, it will only affect the game or program you want to run.  


In our example, you will have to run <code>LC_ALL=ja_JP.UTF-8 wine game.exe</code> to start your game with the Japanese locale. Most of the time, using <code>LANG</code> instead of <code>LC_ALL</code> should be fine but some programs might need to have [https://wiki.archlinux.org/title/Locale#Variables different locale categories] set to the right format. Setting <code>LC_ALL</code> will cover these cases as it sets them all at once.
In our example, you will have to run <code>LC_ALL=ja_JP.UTF-8 wine game.exe</code> to start your game with the Japanese locale. Most of the time, using <code>LANG</code> instead of <code>LC_ALL</code> should be fine but some programs might need to have different locale categories set to the right format as setting <code>LC_ALL</code> will cover these cases as it sets them all at once<ref>https://wiki.archlinux.org/title/Locale#LC_ALL:_troubleshooting</ref>.


If you use a launcher like [[Lutris]], [[Heroic]], [[Steam]] or [[Bottles]], you can set environment variables directly from the GUI. Refer to their documention to do so.
If you use a launcher like [[Lutris]], [[Heroic]], [[Steam]] or [[Bottles]], you can [[Environment variables|set environment variables]] directly from the GUI.


== Fonts ==
== Fonts ==
To render missing special characters like Chinese, Japanese or Korean ones, you might have to install fonts. To do that, install [[Winetricks]], open a terminal emulator and run <code>winetricks allfonts corefont cjkfonts</code> from your Wine prefix. If characters aren't rendered properly, you can [https://learnjapanese.moe/vn-linux/#fonts-do-not-look-right import fonts from a Windows installation].
To render missing special characters like Chinese, Japanese or Korean ones, you might have to install fonts. To do that, install [[Winetricks]], open a terminal emulator and run <code>winetricks allfonts corefont cjkfonts</code> from your Wine prefix. If characters aren't rendered properly, you can import fonts from a Windows installation<ref>https://learnjapanese.moe/vn-linux/#fonts-do-not-look-right</ref>.

Latest revision as of 06:08, 11 May 2025

Some games might require to have different locales enabled on your system.

Generating locales

Before enabling locales, you must generate them first. To do that, uncomment the lines with the locales you want to enable in /etc/locale.gen and run sudo locale-gen inside a terminal emulator. Then, you can list all enabled locales with locale --all-locales[1].

For example, many fan-translated Japanese games require a Japanese locale. To generate it, just uncomment ja_JP.UTF-8 UTF-8 in /etc/locale.gen and run the command above. Most games should work with that locale but you might have to uncomment ja_JP.SJIS SHIFT_JIS or ja_JP.EUC-JP EUC-JP too and regenerate locales[2].

Setting the locale

To set the locale, the easiest way to do it is through environment variables. This way, it will only affect the game or program you want to run.

In our example, you will have to run LC_ALL=ja_JP.UTF-8 wine game.exe to start your game with the Japanese locale. Most of the time, using LANG instead of LC_ALL should be fine but some programs might need to have different locale categories set to the right format as setting LC_ALL will cover these cases as it sets them all at once[3].

If you use a launcher like Lutris, Heroic, Steam or Bottles, you can set environment variables directly from the GUI.

Fonts

To render missing special characters like Chinese, Japanese or Korean ones, you might have to install fonts. To do that, install Winetricks, open a terminal emulator and run winetricks allfonts corefont cjkfonts from your Wine prefix. If characters aren't rendered properly, you can import fonts from a Windows installation[4].