tabularray icon indicating copy to clipboard operation
tabularray copied to clipboard

Make contfoot-text and conthead-text language aware

Open Sonja-K opened this issue 3 years ago • 9 comments

Currently, the caption label correctly responds to a language loaded via babel or polyglossia. Unfortunately, the text corresponding to contfoot-text and conthead-text is hard coded to the english version. While one can easily adjust the text to ones preferences using \DefTblrTemplate, I nevertheless wonder if it would be possible to also make this text language aware by automatically adjusting the text depending on the language provided?

\documentclass{article}
\usepackage[ngerman]{babel}
%\usepackage{polyglossia}
%\setmainlanguage{german}
\usepackage{tabularray} 

\begin{document}
\vspace*{16cm}
\begin{longtblr}[caption={Text}]{}
\hline
first column & second column & third column & last column \\
first column & second column & third column & last column \\
first column & second column & third column & last column \\
first column & second column & third column & last column \\
\hline
\end{longtblr}
\end{document}

jzfthfth

Sonja-K avatar Dec 27 '21 18:12 Sonja-K

I can not speak other languages. So I need help from you and other users. Please write down your translations here. When there are enough translations, I will add them to the package.

lvjr avatar Dec 28 '21 00:12 lvjr

@lvjr Where to contribute the translations to other languages of the required words?

DAbidou avatar Dec 28 '21 12:12 DAbidou

@DAbidou Just write your translations in a comment of this issue.

lvjr avatar Dec 28 '21 13:12 lvjr

rather than add lots of language options to this package it (might) be more flexible to just add some indirection here using the standard \...name convention so rather than directly using { Continued ~ on ~ next ~ page } use { \continuednextpagename } with the macro defined with the English text then any babel language or document preamble can add a localised definition of this command this to the babelextras mechanism \addtoextrasrussian{\renewcommand\continuednextpagename{whatever}}

davidcarlisle avatar Dec 28 '21 15:12 davidcarlisle

@davidcarlisle Do you mean that I only need to define two macros and let babel package do the translations?

lvjr avatar Dec 29 '21 01:12 lvjr

@lvjr yes apart from keeping your package less cluttered (you could end up with a lot of language code if you start adding some) it ends up with a better interface for the user. Consider two-language documents. you (might) want the "next page" language to change according to the current language. If the switch is handled by babel there are already existing mechanisms for the document markup for a small inline language switch that doesn't change the fixed texts or larger block language switches that do chnage these macros.

Initially of course your new \zzzname macros will not be in the default language definition files but they can be added if they prove popular and meanwhile babel offers a standard mechansim via the ..extras.. hooks so that document authors can add localised variants that switch at the right places.

davidcarlisle avatar Dec 29 '21 13:12 davidcarlisle

I can not find \addtoextrasrussian in babel documentation. I think it should be \addto\extrasrussian.

lvjr avatar Dec 29 '21 15:12 lvjr

that's what David meant.

FrankMittelbach avatar Dec 29 '21 15:12 FrankMittelbach

yes sorry, as you said.

On Wed, 29 Dec 2021 at 15:26, Frank Mittelbach @.***> wrote:

that's what David meant.

davidcarlisle avatar Dec 29 '21 15:12 davidcarlisle

I think \tblrcontheadname and \tblrcontfootname are the proper macro names. And I will add them later.

lvjr avatar Aug 22 '22 11:08 lvjr