View on GitHub

# What’s new in babel 3.43

2020-04-28

The most relevant new feature is the loading on the fly based on BCP 47 codes. It must be activated explicitly, because they are meant for special tasks (most document are mainly monolingual). Mapping from BCP 47 codes to locale names are not hardcoded in babel. Instead the data is taken from the ini files, which means currently about 250 tags are already recognized

\documentclass{article}

\usepackage[danish]{babel}

\begin{document}

\today

\selectlanguage{fr-CA}

\today

\end{document}


Babel performs a simple lookup in the following way: fr-Latn-FRfr-Latnfr-FRfr. Languages with the same resolved name are considered the same. Case is normalized before, so that fr-latn-frfr-Latn-FR. If a tag and a name overlap, the tag takes precedence.

Currently the locales loaded are based on the ini files and decoupled from the main ldf files. This is by design, to ensure code generated externally produces the same result regardless of the languages requested in the document, but an option to use the ldf instead will be added in a future release, because both options make sense depending on the particular needs of each document (there will be some restrictions, however).

The behaviour is adjusted with \babeladjust with the following parameters:

• autoload.bcp47 with values on and off.
• autoload.bcp47.options, which are passed to \babelprovide; empty by default, but you may add import (features defined in the corresponding babel-...tex file might not available).
• autoload.bcp47.prefix. Although the public name used in selectors is the tag, the internal name will be different and generated by prepending a prefix, which by default is bcp47-. You may change it with this key.

## Fixes

• Babel reset the \sfcode of » to 1000. Now it’s the default 0.
• \guillemotleft and \guillemotleft renamed to \guillemetleft and \guillemetleft (but old names preserved for backwards compatibility) (#63).
• With autoloading and counters an error could be raised in pdftex.

## Changes in ini locale files

• Assamese: Captions (#58, by Navanath Saharia)
• Finnish: Fixed contents (#61, by Teemu Likonen).
• Marathi: A couple of corrections (from polyglossia #409, by NiranjanTambe), and alphabetic counter.
• Bengali: alphabetic counter.
• Luxembourgish: Much expanded (by Sam Mersch).
• Armenian: Fixed counter names (see the news for 3.42).

## Macros in \selectlanguage

Since its beginnings, an alternative syntax was allowed in the argument of \selectlanguage, so that, say, \selectlanguage{\dutch} is the same as \selectlanguage{dutch}. Now, if the passed macro doesn’t match a loaded language, it’s treated as expected, that is, the string contained in the macro will be the name of the language to be selected. For example, the following piece of code will select dutch

\newcommand{\mylang}{dutch}
\selectlanguage{\mylang}


• Some babel commands have been loaded with the LaTeX format for years, but most of them didn’t work without \usepackage{babel} and raised some cryptic errors. Now in the format some of them have minimal definitions (\addlanguage, \adddialect, \iflanguage, \providehyphenmins) and others raise a more explanatory error (\selectlanguage and other selectors). The macros in the format with minimal definitions behave as described in the babel manual, but without some additional internal actions added by and specific to the babel package (for example, it adds code for \AddBabelHook{..}{adddialect}{..} to work). It should work without rebuilding the format, but it may be necessary in some cases.
• The files switch.def and plain.def will eventually disappear. Their code has been merged into babel.def, but they are still present as proxy files loading the relevant parts now in the latter.