The system I tested it on was 32-bit Ubuntu Feisty 7.04.
The guide is provided at users' own risk. I will try to provide support and answer questions in the thread, but if you somehow type something wrong and send your OS spiraling into /dev/null, don't blame me.
UPDATE: The new WineLocale 0.41 attached to this thread also supports Arabic, Greek, Hebrew and Russian. It is no longer CJK only. However, because this thread is marked CJK in Wine, I won't add the directions to it. Download the file and follow the extra steps in INSTALL to get these languages working.
OK, the web proved totally unhelpful for me to figure this out, so I imagine some of your out there in Ubuntu user-land are having the same problems.
Ordinarily, running a CJK application in Wine results in lots of garbled text. On a good day, you will get empty boxes. On a bad day, it looks like the ASCII table exploded.
No more. I put together a little shell script called WineLocale (after Microsoft's AppLocale which solves the same problem on Windows). So far, it only supports Japanese, Korean, Simplified Chinese and Traditional Chinese. I don't know enough about Hebrew, Arabic and Russian to add those. If you want to help out, by all means. Read ~/.wineloc/patches/HOWTO after installing.
The below directions are all in WineLocale's INSTALL file, but I've repeated them here because they have great generic use for anyone wondering about locales.
Just a note, purgelocales is not a solution because it refuses to show non-ASCII compatible mappings (for example, SJIS, which all pre-XP Japanese applications are).
Step 1: Getting the Locales
Execute the following:
Now open up the three files in a text editor and make certain each contains the following lines.
$ cd /var/lib/locales/supported.d/
# touch ja
# touch ko
# touch zh
If the lines are there and everything is saved, run:
It will throw a warning about SJIS, but trust me, it's OK. Run the command again and everything will say "up-to-date" this time.
# dpkg-reconfigure locales
Next, prepare for a hellishly long download depending on which fonts you have installed (and if you live in, say, China, like me--our Ubuntu mirror sucks)
Next up, even with all those installed, we will be missing a true Chinese font that handles multiple encodings. Don't suggest any of the AR fonts. It will FAIL on the menu bar of a Wine application. This step is necessary.
# apt-get install ttf-arphic-ukai ttf-arphic-uming ttf-kochi-gothic ttf-kochi-mincho ttf-mikachan ttf-mona ttf-sazanami-gothic ttf-saxanami-mincho ttf-vlgothic ttf-alee ttf-arphic-ukai ttf-arphic-uming ttf-baekmuk ttf-unfonts ttf-arphic-bkai00mp ttf-arphic-bsmi00lp ttf-arphic-gbsn00lp ttf-arphic-gkai00mp ttf-arphic-ukai ttf-arphic-uming
We will install Vera Sans YuanTi provided by the Chinese Ubuntu project. Sadly, there's no easy package for this one. We have to do:
If you check the INSTALL file of WineLocale, you'll find information about installing Windows fonts. I will leave it out of this guide, because even without those we will get a fully functioning CJK Wine this way If you want the exact same fonts found in Window, follow that part of the guide.
$ wget http://download.ubuntu.org.cn/software/VeraSansYuanTi.tar.gz
$ tar -zxpvf VeraSansYuanTi.tar.gz
# mv VeraSansYuanTi /usr/share/fonts/
# fc-cache -f
# cp /etc/fonts/fonts.conf /etc/fonts/fonts.conf.old
# cp /usr/share/fonts/VeraSansYuanTi/fonts.conf /etc/fonts/
Step 2: Stealing a nice Wine setup
The default ~/.wine/drive_c created when you run Wine sucks. Hard. It would take a lot of configuring to get something usable, so instead of suffering that, we'll steal one.
Your best bet is to get one from the IEs4Linux project. They provide an amazing setup that, when complete, will contain most of the major system DLLs. I find many applications Wine cannot normally run work fine when I use the IEs4Linux setup. So that's what this guide recommends you do.
Make sure your apt-get sources.list has universe and multiverse enabled, then run the following:
Run the new "ie6" command once and close it. Now do:
# apt-get update
# apt-get install cabextract wine
$ wget http://www.tatanka.com.br/ies4linux/downloads/ies4linux-latest.tar.gz
$ tar zxpvf ies4linux-latest.tar.gz
$ cd ies4linux-*
Step 3: Install WineLocale
$ rm -rf ~/.wine/*
$ cp -r ~/.ies4linux/ie6/* ~/.wine/
Download WineLocale from my website <http://www.cinnamonpirate.com/software/winelocale/> or grab it with wget:
This will install the WineLocale default files in /usr/local/share/wineloc and create a symlink in /usr/local/bin. You can now run "wineloc" from anywhere on your system.
$ wget http://www.cinnamonpirate.com/pub/software/sh/wineloc-0.41.tar.gz
$ tar zxpvf wineloc-0.41.tar.gz
$ cd wineloc-0.41
Step 4: Using WineLocale
WineLocale, at base, is extremely easy to use. The simplest command line is:
-l is the locale flag. If omitted, WineLocale will run it in your current system locale. Valid options are:
$ wineloc -l zh_CN /path/to/executable.exe
[*]ja_JP - Japanese[*]ko_KR - Korean[*]zh_CN - Chinese (Simplified)[*]zh_TW - Chinese (Traditional)
zh_HK and zh_SG will just alias to the other two Chinese modes if you use them. There is also a -o flag that will let you enable DLL overrides (use real DLLs instead of Wine's). This option is tied to a IEs4Linux created Wine setup. If you didn't use theirs, don't touch it or evil magic may happen. Hey, don't complain about "choice": you have the choice not to follow this guide
There's also one more option, -f, which lets you specify a different font group. "common" is the default, but there is also a "win" packed in if you followed the guide to install Windows fonts.
You can create your own font themes and overrides if you explore ~/.wineloc/patches, but that's a topic for another guide.
If you followed everything so far, congratulation, you can now run CJK applications in Wine. On launch, the registry will be hacked up to fit your locale. On exit, everything reverts back to the default so your normal Wine applications won't exhibit any odd behavior. If you manage to "crash" it so settings get stuck, you can run this command to reset all font preferences. Ignore any "errors":
If you check my website, you can see pictures of CJK applications running using WineLocale. To get your Wine applications looking close to the rest of your UI, you need to use "winecfg". Check section iii of INSTALL, "Configuring Wine with winecfg," to see how to do this.
$ regedit /usr/local/share/wineloc/patches/default.reg