Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support \foreignlanguage{austrian}{…} and friends #112

Closed
njbart opened this issue Oct 6, 2015 · 5 comments
Closed

Support \foreignlanguage{austrian}{…} and friends #112

njbart opened this issue Oct 6, 2015 · 5 comments

Comments

@njbart
Copy link

njbart commented Oct 6, 2015

It’s great that polyglossia supports the babel syntax, too. Some of the language variants, however, do not work as expected. E.g.,

\foreignlanguage{english}{\today} and \foreignlanguage{german}{\today} work.

\foreignlanguage{british}{\today} and \foreignlanguage{austrian}{\today} don’t (no output at all).

@meisterluk
Copy link

I attach my issue here because I think the issue is about the general support of Austrian language in polyglossia.

Consider the following MWE

\documentclass{article}
\usepackage{fontspec,lipsum,polyglossia}
\defaultfontfeatures{Ligatures=TeX}
\setdefaultlanguage{austrian}

\begin{document}
\begin{figure}
  \begin{center}
    \fbox{\hbox{\hspace{40pt}HI\hspace{40pt}}}%
  \end{center}
  \caption{Hier sollte ``Abbildung 1'' davor stehen}
\end{figure}

\section{Erstens}
\lipsum[1]

\section{Zweitens}
\lipsum[2-4]

\end{document}

Even though I declared Austrian as default language (same for "mainlanguage"), the caption title is "Figure", hence in English language. But Austrian is a german dialect and should inherits its definition of the caption title "Abbildung" (\setdefaultlanguage{german} works nicely).

As far as I can see the problem can be fixed by defining \captions@austrian in polyglossia.dtx where \captions@austrian inherits definitions of \captions@german.

best regards,
an Austrian

@jspitz
Copy link
Collaborator

jspitz commented Jul 24, 2019

@meisterluk, you have to use

\documentclass{article}
\usepackage{fontspec,lipsum,polyglossia}
\defaultfontfeatures{Ligatures=TeX}
\setdefaultlanguage[variant=austrian]{german}% <-- LOOK HERE

\begin{document}
\begin{figure}
  \begin{center}
    \fbox{\hbox{\hspace{40pt}HI\hspace{40pt}}}%
  \end{center}
  \caption{Hier sollte ``Abbildung 1'' davor stehen}
\end{figure}

\section{Erstens}
\lipsum[1]

\section{Zweitens}
\lipsum[2-4]

\end{document}

See polyglossia manual. The feature request here is to introduce austrian as an alias for that, to have some compatibility with babel, which does not differentiate languages and varieties on the syntax level. Same for other language varieties.

@jspitz
Copy link
Collaborator

jspitz commented Aug 24, 2019

Vice versa, I think it would be a good idea to provide a command \babelname or somesuch that returns the babel name for the current language (variety) (or \empty if babel does not have a counterpart).

This would make it easier for external packages (such as biblatex) I think.

This was referenced Sep 11, 2019
@jspitz
Copy link
Collaborator

jspitz commented Oct 22, 2019

It’s great that polyglossia supports the babel syntax, too. Some of the language variants, however, do not work as expected. E.g.,

\foreignlanguage{english}{\today} and \foreignlanguage{german}{\today} work.

\foreignlanguage{british}{\today} and \foreignlanguage{austrian}{\today} don’t (no output at all).

One problem here is that there are overlapping language names: german in babel is not the same as german in polyglossia. The former is in polyglossia [spelling=old,variant=german]. So at least this case needs to be excluded.
Apart from that, it would be possible now to provide alias commands and environments based on the babel names.

jspitz added a commit to jspitz/polyglossia that referenced this issue Nov 11, 2019
This allows to define alias language names that work in \text<alias>,
the <alias> environment as well as in babel commands.

Prerequisite to address reutenauer#112
jspitz added a commit to jspitz/polyglossia that referenced this issue Nov 13, 2019
This allows to define alias language names that work in \text<alias>,
the <alias> environment as well as in babel commands.

Prerequisite to address reutenauer#112
@jspitz jspitz closed this as completed in 1743b1a Nov 14, 2019
@jspitz
Copy link
Collaborator

jspitz commented Nov 14, 2019

As of v1.46, all babel names can be used as aliases (except for, obviously, german; here, we provide babel's own alias, germanb, as an alternative).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants