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

localising headers #1

Closed
Pika78 opened this issue Apr 25, 2022 · 4 comments
Closed

localising headers #1

Pika78 opened this issue Apr 25, 2022 · 4 comments

Comments

@Pika78
Copy link

Pika78 commented Apr 25, 2022

Hello,
first I would like to thank you for your package, as I find it very useful and a nice addition.
I would like to ask you what would be the best way to 'localize' the header in French. I am trying to print in French : "Notes des pages m à n" and have used the following code:

\usepackage{postnotes}
\ExplSyntaxOn
\NewDocumentCommand \pnheaderdefault {}
{
\tl_if_eq:NNTF \pnhdpagefirst \pnhdpagelast
{ Notesdelapage \pnhdpagefirst }
{ Notesdespages~ \pnhdpagefirst -- \pnhdpagelast }
}
\ExplSyntaxOff

\postnotesetup{
heading={
\section*{\pntitle}
\markright{\pnheaderdefault}
\addcontentsline{toc}{section}{\pntitle}
} ,
}

But all I get printed in the header is : "Note des pages", without the page numbers.
What am I missing ?

Many thanks for you r help.
With best regards.

@gusbrs
Copy link
Owner

gusbrs commented Apr 25, 2022

Hello, first I would like to thank you for your package, as I find it very useful and a nice addition.

Thank you.

I would like to ask you what would be the best way to 'localize' the header in French. I am trying to print in French : "Notes des pages m à n" and have used the following code:

But all I get printed in the header is : "Note des pages", without the page numbers. What am I missing ?

It's hard to tell with just a code snippet. A guess is that, since \pnheaderdefault already exists, you get an error message for trying to define it anew, and you'd have to use \RenewDocumentCommand for your definition to be valid.

But you don't have to redefine \pnheaderdefault at all to localize postnotes for French, you just have to set \pntitle, \pnhdnotes, \pnhdtopage, and \pnhdtopages with proper values. The "Localization" section of the manual describes how to do it, depending on the language package you use. Supposing you are using babel, it'd be something like, for example:

\addto\extrasfrench{\renewcommand*{\pnhdtopages}{des pages}}

But, actually, even if you can set it yourself by these means, I'd love to include proper French support. Could you provide adequate values for the following variables? (these are the English defaults)

\tl_set:Nn \pntitle { Notes }
\tl_set:Nn \pnhdnotes { Notes }
\tl_set:Nn \pnhdtopage { to~page }
\tl_set:Nn \pnhdtopages { to~pages }

The first one is used in the main notes section heading, the remaining three are used for the running headers (you just have to worry about the strings contents there). My first guess, on the little French I know, would be:

\tl_set:Nn \pntitle { Notes }
\tl_set:Nn \pnhdnotes { Notes }
\tl_set:Nn \pnhdtopage { de~la~page }
\tl_set:Nn \pnhdtopages { des~pages }

Are these adequate values for them in French?

@Pika78
Copy link
Author

Pika78 commented Apr 25, 2022 via email

gusbrs added a commit that referenced this issue Apr 25, 2022
@gusbrs
Copy link
Owner

gusbrs commented Apr 25, 2022

Yes the French strings you are proposing are adequate values !

I've just added French localization support, which will be part of the next release.
Thank you!

@gusbrs gusbrs closed this as completed Apr 25, 2022
@Pika78
Copy link
Author

Pika78 commented Apr 25, 2022 via email

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

No branches or pull requests

2 participants