-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Description
This issue tracks how to get consistent handling of i18n translations for Figure, Section, Bibliography, etc. by relying on existing translations used for LaTeX and cleveref.
Based on comments from:
- Update Swedish translations based on defaults used for LaTeX and cleveref #6519 (comment)
- Update Swedish translations based on defaults used for LaTeX and cleveref #6519 (comment)
From @laurmaedje:
This makes me think that we should probably have done that from the start. Just researching the LaTeX name data once and supporting all the languages they support immediately instead of having the terms decided by contributors one by one. I think that came up once in the past, but nobody ever followed up on it...
Thanks! While we should research the LaTeX data more, no need to further wait with this PR.
For reference, the following LaTeX source was used to ensure that the same Swedish translations are used for Typst as those used by LaTeX and cleveref. It can be adapted for other languages.
\documentclass[12pt,a4paper,swedish]{article}
\usepackage{graphicx}
\usepackage{listings}
\usepackage[swedish]{cleveref}
\usepackage[swedish]{babel}
\begin{filecontents}{foo.bib}
@phdthesis{typst_phd,
title={A Programmable Markup Language for Typesetting},
author={M{\"a}dje, Laurenz},
year={2022},
school={Technical University of Berlin}
}
\end{filecontents}
\begin{document}
\tableofcontents
\section{foo}
\label{sec:foo}
Se \cref{fig:foo}.
Se \cref{tab:bar}.
Se \cref{eq:baz}.
Se \cref{sec:foo}.
Se \cref{lst:foobar}.
Se \cite{typst_phd}.
\begin{figure}[htbp]
\centering
\includegraphics[width=0.5\textwidth]{example-image-a}
\caption{foo}
\label{fig:foo}
\end{figure}
\begin{table}[htbp]
\caption{bar}
\label{tab:bar}
\begin{tabular}{ccc}
foo & bar & baz \\
\end{tabular}
\end{table}
\begin{equation}
x = y^2
\label{eq:baz}
\end{equation}
\begin{lstlisting}[language=C, caption={foobar\label{lst:foobar}}]
printf("hello world");
\end{lstlisting}
\bibliography{foo.bib}
\bibliographystyle{ieeetr}
\end{document}