Login  Register

localization of toc-title, figure-caption

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options Options
Embed post
Permalink
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

localization of toc-title, figure-caption

benibilme
Hello,

I am running a site with Hugo and all posts are written asciidoc. The site has multiple languages. Some of the posts are becoming longer and I would like to give table of contents. However table of contents are english.

How can I translate table of contents, figures etc.

I have seen a post at  Old post, but it is pretty old.

Is there a quick way of doing it?

Thanks in advance.
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Re: localization of toc-title, figure-caption

abelsromero
This is what you need https://github.com/asciidoctor/asciidoctor.org/blob/master/docs/_includes/language-support.adoc.
Here you can find the references, you can copy/adapt the ones you need: https://github.com/asciidoctor/asciidoctor/tree/master/data/locale.

To simplify, you can have all required translations (within proper `ifeval::["{lang}" == "--"]` clauses) in a file, and just include it the articles setting the language like seen below.

= Title
:toc:
:lang: es
include::lang-values.adoc[]