flathub / net.ankiweb.Anki

https://flathub.org/apps/details/net.ankiweb.Anki
20 stars 13 forks source link

Anki refuses to start with ja_JP.UTF-8 #74

Closed Resend1298 closed 1 year ago

Resend1298 commented 1 year ago

Sorry if I missed something.


LANG=en_US.UTF-8 flatpak run net.ankiweb.Anki works fine

(LANG=ja_JP.UTF-8) flatpak run net.ankiweb.Anki results

Anki starting...
Traceback (most recent call last):
  File "aqt", line 13, in <module>
UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-2: ordinal not in range(128)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "aqt", line 15, in <module>
Exception: Anki requires a UTF-8 locale.

I uncommented ja_JP.UTF-8 and en_US.UTF-8 in /etc/locale.gen and locale-gen, then set ja_JP.UTF-8 in KDE settings and en_US.UTF-8 in /etc/locale.conf

$ locale
LANG=ja_JP.UTF-8
LC_CTYPE="ja_JP.UTF-8"
LC_NUMERIC="ja_JP.UTF-8"
LC_TIME="ja_JP.UTF-8"
LC_COLLATE="ja_JP.UTF-8"
LC_MONETARY="ja_JP.UTF-8"
LC_MESSAGES="ja_JP.UTF-8"
LC_PAPER="ja_JP.UTF-8"
LC_NAME="ja_JP.UTF-8"
LC_ADDRESS="ja_JP.UTF-8"
LC_TELEPHONE="ja_JP.UTF-8"
LC_MEASUREMENT="ja_JP.UTF-8"
LC_IDENTIFICATION="ja_JP.UTF-8"
LC_ALL=

$ flatpak list -a
Name                                        Application ID                                    Version                    Branch           Installation
Flatseal                                    com.github.tchx84.Flatseal                        1.8.0                      stable           system
Seafile Client                              com.seafile.Client                                8.0.6                      stable           system
Spotify                                     com.spotify.Client                                1.1.84.716.gc5f8b819       stable           system
Steam                                       com.valvesoftware.Steam                           1.0.0.74                   stable           system
Anki                                        net.ankiweb.Anki                                  2.1.54                     stable           system
Freedesktop Platform                        org.freedesktop.Platform                          21.08.14                   21.08            system
i386                                        org.freedesktop.Platform.Compat.i386                                         21.08            system
Mesa                                        org.freedesktop.Platform.GL.default               21.3.8                     21.08            system
nvidia-515-57                               org.freedesktop.Platform.GL.nvidia-515-57                                    1.4              system
default                                     org.freedesktop.Platform.GL32.default                                        21.08            system
nvidia-515-57                               org.freedesktop.Platform.GL32.nvidia-515-57                                  1.4              system
freedesktop platform translations           org.freedesktop.Platform.Locale                                              21.08            system
openh264                                    org.freedesktop.Platform.openh264                 2.1.0                      2.0              system
GNOME Application Platform version 42       org.gnome.Platform                                                           42               system
gnome platform translations                 org.gnome.Platform.Locale                                                    42               system
Breeze GTK theme                            org.gtk.Gtk3theme.Breeze                          5.25.3                     3.22             system
KDE Application Platform                    org.kde.Platform                                                             5.15-21.08       system
kde platform translations                   org.kde.Platform.Locale                                                      5.15-21.08       system
osu!                                        sh.ppy.osu                                        2022.723.0                 stable           system

After installing

Freedesktop SDK                                    org.freedesktop.Sdk                             21.08.14                 21.08          system
freedesktop development platform translations      org.freedesktop.Sdk.Locale                                               21.08          system
$ (LANG=ja_JP.UTF-8) flatpak run --devel --command=sh net.ankiweb.Anki
[📦 net.ankiweb.Anki ~]$ locale
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=ja_JP.UTF-8
LC_CTYPE="ja_JP.UTF-8"
LC_NUMERIC="ja_JP.UTF-8"
LC_TIME="ja_JP.UTF-8"
LC_COLLATE="ja_JP.UTF-8"
LC_MONETARY="ja_JP.UTF-8"
LC_MESSAGES="ja_JP.UTF-8"
LC_PAPER="ja_JP.UTF-8"
LC_NAME="ja_JP.UTF-8"
LC_ADDRESS="ja_JP.UTF-8"
LC_TELEPHONE="ja_JP.UTF-8"
LC_MEASUREMENT="ja_JP.UTF-8"
LC_IDENTIFICATION="ja_JP.UTF-8"
LC_ALL=
$ LANG=en_US.UTF-8 flatpak run --devel --command=sh net.ankiweb.Anki
[📦 net.ankiweb.Anki ~]$ locale
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=
Resend1298 commented 1 year ago

I uninstall && installed org.freedesktop.Platform.Locale. Now it's working but I'm still confused.

It seems that previously installed org.freedesktop.Platform.Locale lacks ja_JP.UTF-8 and I just don't know how.