Multilingual Galleries?

11 views
Skip to first unread message

Ekoloska Udruga Zrmanja Vrelo

unread,
Sep 26, 2020, 3:43:00 PM9/26/20
to nikola-discuss
Hello,

I'm using nikola to publish a web page in three languages. Default is hr
(Croatian), additional de (German) and en (English). Now I have an issue
with the galleries funktion and two questions:


-1- How can I rename the "galleries" folder concerning the page
language? I found this for pages in conf.py :


PAGES = (
    ("pages/*.md", {"en": "pages", "de": "seiten", "hr": "stranice"},
"page.tmpl"),

...


This works as expected an produces this folders:

/

/stranice         (Rem: hr is default language)

/de/seiten

/en/pages


But how can I achieve the same for the folder "/galleries"? I tried
diffent versions of something like this -all without success:


GALLERY_FOLDERS = {"en": {"galleries": "en/galleries/" }, "de":
{"galleries": "de/galerien/"}, "hr": {"galleries": "galerije"}}


Looks like no dictionary data type is accepted here. I got build errors
like this:


  File
"/home/eric/nikola/lib/python3.8/site-packages/nikola/plugins/task/galleries.py",
line 94, in set_site
    if source in appearing_paths or dest in appearing_paths:
TypeError: unhashable type: 'dict'


-2-

Is it possible to give diffrent names to the same gallery folder or how
to replace the title of the gallery with something I can define beside
foldername, depending of language?

Here I have no idea how to start. Perhaps it is not possible at all?


Thank you for your advices!

Eric.

Ekoloska Udruga Zrmanja Vrelo

unread,
Sep 26, 2020, 4:47:53 PM9/26/20
to nikola-...@googlegroups.com
Update:


I looked further and found a hint about index.txt file in the folder
"/galleries".


I created three files with each one line of content:

/galleries/index.txt  # for hr

.. title: Galeria

/galleries/index.de.txt

.. title: Galerien

/galleries/index.en.txt

.. title: Galleries


And now the title of the galleries main folder is multilingual.

I think this answers my question -1-.


Let's see if this solves the other issue, too.

Ekoloska Udruga Zrmanja Vrelo

unread,
Sep 26, 2020, 5:20:33 PM9/26/20
to nikola-...@googlegroups.com
[solved]

Yeah! The index.txt file solved also question -2-.

Additionoal I found that I can have some description above the pictures
in the gallery:

/galleries/collection1/index.txt

.. title: Collection 1

some comment

/galleries/collection1/index.de.txt

.. title: Kollektion 1

ein Kommentar

Results in multilingual gallery title and adds the comment under it and
above the pictures.

Great - this I was looking for. :)


Sorry for disturbing you. Perhaps someone finds this posts helpful anyhow.

Eric.


Reply all
Reply to author
Forward
0 new messages