Site.language returns the site's language, of course. Is there a simple way to get a List<string> or string[] with all language abbreviations of ISO 639 that are used by WMF projects (including projects like simple and zh-min-nan)?
Of course, it's no problem to get such a list by copy&paste from different Wikipedia or Wikimedia sites and include the list into the bot's source code. IMHO it's a better programmatical way to fill the list inside the application by a Site method. Juergen
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
you can find all interwiki codes that are recognized locally, delimited by '|' character.
These include not only the language codes but also tags like "betawikiversity".
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Then wouldn't it be better to find relevant items in GetWikimediaProjects()? The following code will do the job:
var langs = (from s in siteObj.GetWikimediaProjects(true)
where Bot.CountMatches(s, ".", false) == 2
select s.Substring(0, s.IndexOf('.'))).Distinct().ToList();
Last edit: CodeDriller 2015-01-29
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
GetWikimediaProjects() was my proposal two contribs ago. Thank you for the full code. (I don't know anything about LINQ and should use a loop instead of.) Juergen
PS. Is there a way to declare a thread finished?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Site.language returns the site's language, of course. Is there a simple way to get a List<string> or string[] with all language abbreviations of ISO 639 that are used by WMF projects (including projects like simple and zh-min-nan)?
Of course, it's no problem to get such a list by copy&paste from different Wikipedia or Wikimedia sites and include the list into the bot's source code. IMHO it's a better programmatical way to fill the list inside the application by a Site method. Juergen
In the variable
you can find all interwiki codes that are recognized locally, delimited by '|' character.
These include not only the language codes but also tags like "betawikiversity".
Thank you. Site.generalData["interwiki"] works but it isn't a proper way (like you told). A better way could be
All the different prefixes give a list of used language abbreviations. Juergen
Execuse me, I don't quite understand. What different prefixes must give a list of language abbreviations? What the resultant list should look like?
I mean prefixes like these (as combined string - with colons or without):
The following items of Site.generalData["interwiki"] don't belong to the list of languages:
Juergen
Then wouldn't it be better to find relevant items in GetWikimediaProjects()? The following code will do the job:
Last edit: CodeDriller 2015-01-29
GetWikimediaProjects() was my proposal two contribs ago. Thank you for the full code. (I don't know anything about LINQ and should use a loop instead of.) Juergen
PS. Is there a way to declare a thread finished?
Maybe like this:
:-)