Description

When translating Miosis from English to Swedish, the infobox is added into the translation with empty parameters:

In this case, the infobox is based on the template "Infobox medical condition (new)" which exists in both English and Swedish and it is connected through Wikidata. In this case, the Swedish version lacks templateData information (which prevents CX from completing the mapping), but the parameters used in the template are exactly the same since the template was ported into Swedish from English. In this particular case, on CX1 copying the original template over would work while that is not possible in CX2.

For cases where templateData is missing, Content Translation can consider matching the existing parameters by name as a fallback approach.

For cases where templateData is missing, Content Translation can consider matching the existing parameters by name as a fallback approach.

We were using a regular expression to extract template params from template source code when templatedata is missing. We had to improve it to avoid T199308: CX2: Avoid using inexistent parameters when mapping template parameters The side effect is, when params are extracted they are not false positives. The negative effect is, sometimes we will miss to extract some params. That is the trade off for making sure we don't add inexistant params to translation.

This particular article(before Doc james fixed templatedata in ja.wiki) has the situation of source language having templatedata, target language missing template data and templates being same.

In this case, while extracting the template params from template source code, we can use the help of source template data. That is, use the improved regex and then use the old regex but filter out params that does not exist in source template params in source template data.

Needless to say, having templatedata in both wikis, or even better, in a central place is the path we need to go ultimately.

The en->ja pair now has template data in both languages. From history, I see User:Doc James added that to ja.wikipedia.org

I updated the example to use en -> sv, since the Swedish version of the template still lacks template data. This may facilitate the testing process (at least until someone adds the missing templateData for Swedish)