fr_FR.UTF-8 および C.UTF-8 ロケールは、ロケールリストで使用できないため使用できません。 [閉じる]

fr_FR.UTF-8 および C.UTF-8 ロケールは、ロケールリストで使用できないため使用できません。 [閉じる]

fr_FR.UTF-8ロケールはC.UTF-8ロケールリスト(提供)では利用できないためlocale -a使用できません。

追加する方法は次のとおりです。

$ sudo locale-gen en_US en_US.UTF-8 fr_FR fr_FR.UTF-8 
Generating locales...
  en_US.ISO-8859-1... up-to-date
  en_US.UTF-8... up-to-date
  fr_FR.ISO-8859-1... up-to-date
  fr_FR.UTF-8... up-to-date
Generation complete.
$ sudo dpkg-reconfigure locales 
Generating locales...
  en_AG.UTF-8... done
  en_AU.UTF-8... done
  en_BW.UTF-8... done
  en_CA.UTF-8... done
  en_DK.UTF-8... done
  en_GB.UTF-8... done
  en_HK.UTF-8... done
  en_IE.UTF-8... done
  en_IN.UTF-8... done
  en_NG.UTF-8... done
  en_NZ.UTF-8... done
  en_PH.UTF-8... done
  en_SG.UTF-8... done
  en_US.ISO-8859-1... up-to-date
  en_US.UTF-8... up-to-date
  en_ZA.UTF-8... done
  en_ZM.UTF-8... done
  en_ZW.UTF-8... done
  fr_BE.UTF-8... done
  fr_CA.UTF-8... done
  fr_CH.UTF-8... done
  fr_FR.ISO-8859-1... up-to-date
  fr_FR.UTF-8... up-to-date
  fr_LU.UTF-8... done
Generation complete.
$ export LC_CTYPE=C.UTF-8
$ export LC_COLLATE=C.UTF-8
$ export LC_MESSAGES=fr_FR.UTF-8
$ locale -a
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_COLLATE to default locale: No such file or directory
C
POSIX
en_US.utf8

編集1:私のシステムではlocale-gen少し古いので、パラメータを受け入れることができます(パッケージロケールv2.13)。

とにかく関連する他の方法/etc/locale.genも機能しません。

$ cat <<-EOF | sudo tee -a /etc/locale.gen
en_US.UTF-8 UTF-8
en_US ISO-8859-1
en_US.ISO-8859-15 ISO-8859-15
fr_FR.UTF-8 UTF-8
fr_FR ISO-8859-1
fr_FR@euro ISO-8859-15
EOF
en_US.UTF-8 UTF-8
en_US ISO-8859-1
en_US.ISO-8859-15 ISO-8859-15
fr_FR.UTF-8 UTF-8
fr_FR ISO-8859-1
fr_FR@euro ISO-8859-15
$ sudo locale-gen
Generating locales...
  en_AG.UTF-8... up-to-date
  en_AU.UTF-8... up-to-date
  en_BW.UTF-8... up-to-date
  en_CA.UTF-8... up-to-date
  en_DK.UTF-8... up-to-date
  en_GB.UTF-8... up-to-date
  en_HK.UTF-8... up-to-date
  en_IE.UTF-8... up-to-date
  en_IN.UTF-8... up-to-date
  en_NG.UTF-8... up-to-date
  en_NZ.UTF-8... up-to-date
  en_PH.UTF-8... up-to-date
  en_SG.UTF-8... up-to-date
  en_US.ISO-8859-1... up-to-date
  en_US.UTF-8... up-to-date
  en_ZA.UTF-8... up-to-date
  en_ZM.UTF-8... up-to-date
  en_ZW.UTF-8... up-to-date
  fr_BE.UTF-8... up-to-date
  fr_CA.UTF-8... up-to-date
  fr_CH.UTF-8... up-to-date
  fr_FR.ISO-8859-1... up-to-date
  fr_FR.UTF-8... up-to-date
  fr_LU.UTF-8... up-to-date
Generation complete.
$ locale -a
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_COLLATE to default locale: No such file or directory
C
POSIX
en_US.utf8

fr_FR.UTF-8ロケールは、指定されたC.UTF-8ロケールのリストではまだ使用できませんlocale -a

どうすればいいですか?

ベストアンサー1

locale-genコマンドライン引数を許可しません。代わりに、/etc/locale.gen生成するロケールのリストを読みます。

/etc/locale.gen必要なロケールのコメントを削除してlocale-gen再実行するように編集します。

または、コメントアウトされた行がない場合は、/etc/locale.genサポートされているロケールのリストを見つけてそこからコピーしてください。 Debian(および関連ディストリビューション)では、そのリストを に見つけることができます/usr/share/i18n/SUPPORTED

おすすめ記事