Re: Debian Wiki - macro like <<DebianCodenameLink(oldstable)>> for translated pages?

Beatrice Torracca <[email protected]>
Newsgroups gmane.linux.debian.devel.www
Message-ID <[email protected]>
On sabato 14 settembre 2019, at 07:56 +0800, Paul Wise wrote:
> On Sat, Sep 14, 2019 at 12:11 AM Beatrice Torracca wrote:

Hi,
> 
> > Is it possible to implement similar macros for the translated pages.
> 
> It should be possible to do that, the options are:
> 
> > Something along the line of <<DebianCodenameLinkNN(oldstable)>> where NN is the language code, at least for those languages which ask for it?
> * Add a language parameter: <<DebianCodenameLink(nn oldstable)>>
> * Use the declared language of the page that is calling the macro when
> generating the links.
> 
> Personally I like the last option because it means almost zero work
> for translators, they just have to ensure the page language is
> declared correctly, which, from a small sample, appears to already be
> the case for probably many if not all of the translated pages.

Your idea is definitely better than mine

> 
> Would you be interested in working on this? If so, the Python code for
> Debian's custom macros is here:
> 
> https://salsa.debian.org/debian/wiki.debian.org/tree/master/var/moin/data/plugin/macro
> 
> If not I can take a look at how to find the current page language and
> how to detect if the translated page exists, it should be easy to fix
> the code once those are known.

Sadly I am no programmer. I have some very rudimentary skills that
make me tweak some previous code if it is easy to do. This is way
beyond my skills, sadly.

But I made some searches... with almost no useful results and probably
you know all this already :) ... but in case it might help whomever could
work on this these are the results.

There is a macro in the MoinMoing api to find if a page exist:

https://moinmo.in/MoinAPI/Examples#Page.exists.28.29

I did not find anything on a way to extract the iso-code of the language (that does not mean it does not exist). The only ugly workaround I could think of is to search in the raw content of the page for "# language NN".
But since there is the possibility of searching pages on the basis of their language there must be a better way to extract the language.

Thanks a lot for the reply,

beatrice
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.