Add the Japanese Locale to Ubuntu 19.10

Ubuntu

Even if you set LANG=ja_JP.UTF-8, if the locale definition does not exist you will see error messages like the following.

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 

Add the Japanese locale with the locale-gen command.

$ sudo locale-gen ja_JP.UTF-8

You can see that it has been added.

 $ locale -a
 C
 C.UTF-8
 POSIX
 en_US.utf8
 ja_JP.utf8