-
Notifications
You must be signed in to change notification settings - Fork 12
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
Set html
element's attribute lang
according to document's language
#26
Conversation
Hi, I am a bit concerned about default behaviour. At the moment if no language is specified, the PR emits a I'd also like to have a look at the |
More precisely, while parsing the options of package pkg, if an option 'key' is not declared (by \DeclareOption from package.hva), then option @defopt is called with argument 'key'. See the handling of 'main=<lang>' by babel.hva for an example.
My commit to your PR attempts precisely to do this. I had to modify |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good and passed all my tests.
Now main=
works as expected.
I am glad it does. What about my other comment on not having a lang attribute when no language is specified? |
I know you are afraid of breaking backward compatibility with
So, I'm inclined to have a default |
Hi, Ok I see. Although I'd rather had have language unspecified for pages in English, that pages in French with lang="en" specification, I'll follow your suggestion and merge the PR. Thanks a lot for your contribution. |
#26) * Set `html` element's attribute `lang` according to the LaTeX document's language. * Enhance \usepakage optional argument. More precisely, while parsing the options of package pkg, if an option 'key' is not declared (by \DeclareOption from package.hva), then option @defopt is called with argument 'key'. See the handling of 'main=<lang>' by babel.hva for an example. Co-authored-by: Luc Maranget <Luc.Maranget@inria.fr>
This P/R addresses issue #25. Its primary
target is to provide transparent setting of the
lang
attribute for the whole HTML documentbased on the LaTeX
\selectlanguage
(in the preamble)It has turned out that the central function, a
map from babel language names
(e.g.
swissgerman
) to language codes(e.g.
de-CH
) is also suitable to implementsome of the missing babel environments and
macros e.g.
\foreignlanguage{LANG}{TEXT}
.Their implementation is trivial. The
documentation has been extended and updated
accordingly.
Known Problem: Babel allows for a quirky way
to set the document's main language
which makes
italian
the main language. ThisP/R partially implements parsing the
main
modifier, but ''babel.hva'' ignores it (due to
standard parsing of the package's options) and
thus the document's main language is wrongly
detected when
main=
is used.