Login to Wikidata causes a KeyNotFoundException in line 343 by the following circumstances:
There are two work-arounds (see also feature request 29):
The second way could be done as follows:
foreach (var alias in aliases) { if(namespaces.ContainsKey(alias.code)) { namespaces[alias.code] += alias.name + '|'; } else { namespaces[alias.code] = '|' + alias.name + '|'; } }
By the way, in some cases (mostly in English spoken wikis) several namespace names are doubled, e.g.:
Wikidata:
-2 >> |Media|Media|
-1 >> |Special|Special|
1 >> |Talk|Talk|Item talk|
2 >> |User|User|
3 >> |User talk|User talk|
de-Wikibooks:
8 >> |MediaWiki|MediaWiki|
102 >> |Regal|Regal|
103 >> |Regal Diskussion|Regal Diskussion|
I don't know in which cases kvp.Value is needed and splitted. Perhaps it would be better to remove double values. Juergen
Yes. I never thought that default namespace (0) could have an alias, that's weird. Nevertheless I'll add such option. I'd better add a key-value pair with key 0 to namespaces Dictionary<>.
Fixed in v3.14.