Page MenuHomePhabricator

translate : error on array line occurs when the reference is declared later in the array
Open, LowestPublicBUG REPORT

Description

Steps to Reproduce:

  1. open https://www.mediawiki.org/wiki/Translations:Help:Extension:TemplateWizard/19/fr

or https://www.mediawiki.org/w/index.php?title=Translations:Help:Extension:TemplateWizard/19/fr&diff=3516613&oldid=3516611&diffmode=source

  1. It is the translation of an array cell using reference not declared in the same translation unit.

Actual Results:

  1. see the error message :

Cite error: <ref> tags exist for a group named "fn", but no corresponding <references group="fn"/> tag was found, or a closing </ref> is missing

  1. observe on the root page, that the definition of the group in the reflist is done at the end of the array |colspan="5"|{{smaller|{{reflist|group=fn}}}}
  2. observe that this error is tracked in https://www.mediawiki.org/wiki/Special:RecentChanges 24 November 2019 00:04 Category:Pages with reference errors‎‎ 2 changes [Wladek92‎ (2×)] 00:04 Wladek92 talk contribs Translations:Help:Extension:TemplateWizard/19/fr added to category 00:03 Wladek92 talk contribs Translations:Help:Extension:TemplateWizard/18/fr added to category
  3. observe that the root page is not listed in error (which is ok, since it is coherent) - but (...?) neither are the translated pages above https://www.mediawiki.org/wiki/Category:Pages_with_reference_errors

Expected Results:

  1. do not show error at level of the translated message since error should appear only at the level of the root page if the group where really not defined

Reference;
Talk topic : https://www.mediawiki.org/wiki/Topic:Vbo3j4hagy6maa9u

Event Timeline

Wladek92 renamed this task from translate : line error on array line occurs when the reference is declared later in the array to translate : error on array line occurs when the reference is declared later in the array.Nov 24 2019, 9:53 AM
Wladek92 updated the task description. (Show Details)

@Wladek92: Assuming this task is about the Translate extension itself, hence adding project tag so others can find this task when searching for tasks under that project or looking at that project workboard.

A potential solution to this is to disable parsing on Translations: namespace. Maybe there is a hook that can be used to set content type to plain text.

A potential solution to this is to disable parsing on Translations: namespace. Maybe there is a hook that can be used to set content type to plain text.

I often use

{{#ifeq:{{NAMESPACE}}|Translations|{{speedy|not a translation}}}}

to get translation units consisting of copy-paste of the English original and other non-translations deleted without marking the whole translated page for translation (as it may contain real translation in other translation units). Also, every now and then I edit translation units using WikiEditor instead of Tux so that I can preview them (e.g. to see how language-dependent templates and parser functions behave.) Not parsing pages in the Translations: namespace would make these workflows impossible, and I’d very much like to keep them.

(By the way, there would certainly be a way to set the content type for a namespace: Scribunto, Wikibase and other extensions do exactly this. But the functionality loss is too big IMO compared to the gain of avoiding reference and other errors.)