Avoid extra API request for the source wiki language

Authored by thiemowmde on May 23 2019, 3:03 PM.


Avoid extra API request for the source wiki language

What this patch does:

  1. Use the original API request we are doing anyway to request the

language of the file description page from the source wiki.

  1. Store this language code in the ImportDetails object, where it


  1. Use that during wikitext cleanup. No need to do anything else. No

site table lookup, no extra API request. All these extra service calls
aren't needed any more in the factory.

Note: I'm introducing another setter in ImportDetails. Most, if not all
these setters should be changed to constructor parameters later. I would
like to do this later to not make this patch here more complicated and
hard to review.

Note: This is intentionally using the normalized "HTML version" of the
language code. These are more likely to have templates, required for
I563d84f (T198607).

Bug: T224122
Change-Id: I230c142831218eb6361d0e41851a7e55566ea9c4