Pergunta

I'm working on a process for transcribing and translating documents that combines Extension:Proofread Page and Extension:Translate. Proofread Page applies different background colors to each link in the list based on the page status (scan uploaded, transcribed, proofread, etc.), and I'd like to extend that to apply to translation as well.

Changing the background color is simple enough using a template like this:

[[page:{{{1|}}}|<span style="background-color:#48d1cc;">{{{2|}}}</span>]]

The trouble is making it contingent on the existence of an English translation, which would be stored at {{PAGENAME}}/en. This #ifexist: function solves that problem:

{{#ifexist: page:{{{1|}}}/en
  | [[page:{{{1|}}}|<span style="background-color:#48d1cc;">{{{2|}}}</span>]]
  | [[page:{{{1|}}}|{{{2|}}}]]
}}

But #ifexist is classified as an "expensive" parser function and limited to 100 per page, whereas I have some indexes with upwards of 700 links.

Obviously I can just require that the first template I mentioned be manually invoked for each page as a translation is created (i.e. replacing [[page: ]] with {{page| }} in the index one link at a time), but I'd prefer a fire-and-forget solution that I can use when I initially create each index.


So is there either

  1. A way to exceed the expensive parser function cap in mediawiki?
  2. Some trick for applying conditional css in this situation without invoking #ifexist?

Or, I guess,

  1. An easy hack for Extension:Proofread Page that would solve this problem?

    MediaWiki: 1.19.2
    Semantic MediaWiki: 1.8 beta 1
    PHP: 5.3.10-1ubuntu3.6 (apache2handler)
    MySQL: 5.5.29-0ubuntu0.12.04.2

Foi útil?

Solução

You can raise the cap by bumping $wgExpensiveParserFunctionLimit in LocalSettings.php.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top