Fixes <http://bugs.gnu.org/22572>.
Reported by Mark H Weaver <mhw@netris.org>.
* gnu/system/locale.scm (%not-dot): New variable.
(denormalize-codeset, locale-name->definition): New procedures.
* gnu/system.scm (locale-name->definition*): New procedure.
(operating-system-locale-directory): Instead of raising an error, add
the missing locale.
* doc/guix.texi (Locales): Adjust accordingly.
* gnu/system/locale.scm (localedef-command)[maybe-version-directory]:
New procedure.
Use it.
(locale-directory): Rename to...
(single-locale-directory): ... this. Check the version of LIBC to
determine whether to create a "X.Y" sub-directory or to make it a
symlink to ".". Add the version number in the derivation name.
(locale-directory): New procedure.
(%default-locale-libcs): New variable.
* gnu/system.scm (<operating-system>)[locale-libcs]: New field.
(operating-system-locale-directory): Pass it to 'locale-directory'.
* doc/guix.texi (operating-system Reference): Document 'locale-libcs'.
(Locales)[Locale Data Compatibility Considerations]: New section.
* gnu/packages/base.scm (glibc)[arguments]: Append VERSION to
'libc_cv_localedir'.
* gnu/system/locale.scm (localedef-command): Write to the sub-directory
called (package-version libc) in #$output.
(locale-directory): Create said directory.
* doc/guix.texi (Locales): Mention the per-version sub-directory.
* doc/guix.texi (Locales): Introduce "codeset".
<%default-locale-definitions>: Mention the "normalized codeset", with
an xref to libc's manual.
* gnu/system/locale.scm (%default-locale-definitions)[utf8-locale]:
Mention the "normalized codeset" in a comment.
* gnu/system/locale.scm: New file.
* gnu-system.am (GNU_SYSTEM_MODULES): Add it.
* gnu/system.scm (<operating-system>)[locale]: Change the default to
"en_US.utf8".
(operating-system-locale-directory): New procecure.
(operating-system-derivation): Use it.
* doc/guix.texi (Using the Configuration System): Change example locale
to "fr_FR.utf8".
(operating-system Reference): Add xref to "Locales". Document
'locale-definitions'.
(Locales): New section.
* po/guix/POTFILES.in: Add gnu/system.scm.