💾 Archived View for gmi.derschwarzestrahler.at › en › gemlog › incomplete-bilingual.gmi captured on 2023-05-24 at 17:41:56. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2023-01-29)

➡️ Next capture (2023-07-10)

-=-=-=-=-=-=-

My incomplete bilingual Capsule

German is my mother tongue I know best. On the other hand, writing in english gives a bigger audience. Therefore I decided to try out to make my gemini capsule bilingual. Here are some notes about it.

Technical background

Technically it is quite easy to make a biligual site. Well, there is one obstacle: Unlike HTML, where metadata like language, encoding and even redirects can be added into the header section of every html-file, the .gmi files by design contain only content. Nevertheless, metadata is handled in the Gemini protocol, so the server have to implement something to deal with it. The Gemini server I use, agate, brings a very basic but easy to implement functionality: You can add a file called ".meta" in every directory, in which you define metadata for all the files in this directory (and also for subdirectories). I use these files very extensively.

The agate website gives some examples, how to implement different MIME-header languages for individual .gmi files:

gemini://qwertqwefsday.eu/agate.gmi

But attention, I found a minor bug in this description: It suggests to use the MIME language descriptor "en-UK". However, according to the IANA register for language shortcuts [1], the correct code for English as spoken in the United Kingdom is not "en-UK", but "en-GB" [2]. Besides that you can follow the description there. You for example define, that every gemini file, which has the suffix ".en.gmi" is in english, while those only with ".gmi" are german:


The order of the statements is important here, since we have an overlap of two rules. In such a case, the latest rule is applied finally. In this case, this means, that the rule for "*.gmi" is first applied to all .gmi files (also the ".en.gmi"s). Afterwards, the ".en.gmi" rule is applied to the respective files.

I started to use this rule first, but then I decided to use the approach to put the english language files in the subdirectory "en/". This is what I did: First, I put in the root directory a .meta-file with


Note, that I use the double star wildcard, which means, that this rule applies to this directory and all its subdirectories. In the "en/" subdirectory I add a .meta-file with the rule, that here everything is in english:


So basically, I now have my main site in german and a subsite in english. From here, things get a bit tricky.

Handling a bilingual capsule

Short and simple, I now have somehow two capsules to maintain. Am I up to this task? Well, only partially. After the first day having my new capsule, I already realised, that I will not have a fully bilingual capsule with every content translated in both languages every time. Instead, both the german and the english part will be incomplete, with specific contents either only one language or in the other. In some cases this is intended, this gemlog entry for example is here only in the english version, and I don't plan to translate it.

On the other hand, there are already a few contents, which I want to translate, but I haven't found time for it yet. My text about Star Wars,

gemini://gmi.derschwarzestrahler.at/gemlog/traumwelt-von-star-wars.gmi

is currently only available in german, but it will be here in english some day. There is a way to implement the message, that a translation is planned, somehow in the .meta files. I added this line into the .meta file in my english gemlog folder, which defines a redirect:

dreamworld-of-star-wars.gmi: 30 ../../gemlog/traumwelt-von-star-wars.gmi

The file dreamworld-of-star-wars.gmi doesn't exist at the time this text is written, only this rule. so clicking on this link

gemini://gmi.derschwarzestrahler.at/en/gemlog/dreamworld-of-star-wars.gmi

will redirect you to the german version of this text on the site linked above. The response code 30 means a temporary redirect according to the gemini protocol. This means, that this redirect will be removed at some point in the future, when the site is available. I just don't know when. I handle it the same with a few other sites in my capsule, for example my introduction site, which is currently only in german, or my astrobotany plant gallery, which is currently only in english.

What I am a little bit concerned about is, that I maintain my capsule completely manually at the moment. I am looking for a content management system, but I think I have to code something myself, that fits to my workflow. Nevertheless, I can live with the incompleteness in both language versions of my capsule. Time will tell how this will evolve in the future.

Footnotes

[1] IANA Language Subtags, search in page for "Region: United Kingdom"

[2] I reported this issue.

CC BY-SA 4.0 Martin Marot-Perz, 2022

⇑ Gemlog

    ╭────────╮    ╔═════╗
  ╭─╯████████╰─╮  ╔═══╗ ╚═╗
 ╭╯████████████╰╮ ╔══╗╚═╗ ╚╗
╭╯██████████████╰╮╔═╗╚╗ ╚╗ ╚╗
│████████████████   ║ ║  ║  ║
╰╮██████████████╭╯╚═╝╔╝ ╔╝ ╔╝
 ╰╮████████████╭╯ ╚══╝╔═╝ ╔╝
  ╰─╮████████╭─╯  ╚═══╝ ╔═╝
    ╰────────╯    ╚═════╝