"Pedro A. Aranda" <[email protected]> writes:
> Subject: [PATCH] Add OTHER_LANGUAGES to the metadata
I think the patch is good in general.
> +- =OTHER_LANGUAGES= ::
> +
> + #+cindex: @samp{OTHER_LANGUAGES}, keyword
> + #+vindex: org-export-other-languages
> + List of secondary languages present in the document.
Nit: "space-separated list".
> + For example:
> + #+begin_src org
> +,#+LANGUAGE: en
> +,#+OTHER_LANGUAGES: es, fr
#+OTHER_LANGUAGES: es fr
> +*** New custom variable ~org-export-other-languages~
> +
> +Org allows you to indicate secondary languages (as opposed to the main
> +language stored in ~org-export-default-language~). This variable is a
> +lisp of Org language codes and can also be indicated with keyword
Nit: *list
> + ;; We might need a function here to
> translate from
> + ;; Org to BCP-47 language codes
Nit: We can mark this comment with FIXME: so that it is more visible.
> +(defcustom org-export-other-languages nil
> + "A list of strings with the Org language codes for other languages
> +used in the document.
> +
> +ox-latex inserts this list as \"other-languages = {<list>}\" in
> +the document metadata (along with the export language defined in the
> +#+LANGUAGE: keyword as \"language = {<lang>}\"), when the shorthand
> +DOC_LANGS is included in `org-latex-doc-metadata'."
I think we should not provide all these details about ox-latex inside a
docstring in ox.el. I suggest describing these details in
`org-latex-doc-metadata' docstring. In ox.el, we can simply refer to
that variable then. WDYT?
> + :package-version '(Org . "10")
> + :type '(repeat
> + (string :tag "Other languages used in the document."))
The value can also be nil.
> + (let ((doc-metadata (plist-get info :latex-doc-metadata)))
> + (when (and doc-metadata
> + (string-match-p "DOC_LANGS" doc-metadata))
I nice optional feature would be allowing org-latex-doc-metadata value
to be 'auto - populate all the possible the metadata fields.
It can be an equivalent of
#+LATEX_DOC_METADATA: tagging = on, DOC_LANGS
and maybe more things we add in future.
Similar to what we have in org-html-postamble.
Not a blocked for this patch though.
>> I am not sure if we can simply move it.
>
> Neither was I and the stress was on TOWARDS... And the Rationale in the
> commit message, just to show my thoughts.
Unfortunately, it was not fully clear to me that your intention is just
discussing the patch. I interpreted it as the first patch that will
follow by new different patches related to multi-language export to
LaTeX.
It would be easier if you clearly stated that the patch is some kind of
"draft". Just for future reference to avoid confusion.
--
Ihor Radchenko // yantar92,
Org mode maintainer,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>