-
-
Notifications
You must be signed in to change notification settings - Fork 729
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Show wikidata editor for non-local descriptions #2676
Conversation
pass source when publishing wikidata description
Wikipedia/Code/MWKArticle.m
Outdated
@@ -97,7 +98,7 @@ - (BOOL)isEqual:(id)object { | |||
} | |||
|
|||
- (BOOL)isEqualToArticle:(MWKArticle *)other { | |||
return WMF_EQUAL(self.url, isEqual:, other.url) && WMF_EQUAL(self.lastmodified, isEqualToDate:, other.lastmodified) && WMF_IS_EQUAL(self.lastmodifiedby, other.lastmodifiedby) && WMF_EQUAL(self.displaytitle, isEqualToString:, other.displaytitle) && WMF_EQUAL(self.protection, isEqual:, other.protection) && WMF_EQUAL(self.thumbnailURL, isEqualToString:, other.thumbnailURL) && WMF_EQUAL(self.imageURL, isEqualToString:, other.imageURL) && WMF_EQUAL(self.revisionId, isEqualToNumber:, other.revisionId) && self.articleId == other.articleId && self.languagecount == other.languagecount && self.isMain == other.isMain && self.sections.count == other.sections.count; | |||
return WMF_EQUAL(self.url, isEqual:, other.url) && WMF_EQUAL(self.lastmodified, isEqualToDate:, other.lastmodified) && WMF_IS_EQUAL(self.lastmodifiedby, other.lastmodifiedby) && WMF_EQUAL(self.displaytitle, isEqualToString:, other.displaytitle) && WMF_EQUAL(self.protection, isEqual:, other.protection) && WMF_EQUAL(self.thumbnailURL, isEqualToString:, other.thumbnailURL) && WMF_EQUAL(self.imageURL, isEqualToString:, other.imageURL) && WMF_EQUAL(self.revisionId, isEqualToNumber:, other.revisionId) && self.articleId == other.articleId && self.languagecount == other.languagecount && self.isMain == other.isMain && self.sections.count == other.sections.count && self.descriptionSourceNumber == self.descriptionSourceNumber; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
==
in obj-c only compares the pointers, so this is true only if they're the exact same object, not the same number. Also, it's self.
here on both sides instead of self.
and other.
It looks like WMF_EQUAL(self.descriptionSourceNumber, isEqualToNumber:, other.descriptionSourceNumber)
handles nil cases and equality of the underlying numbers properly
Correct
There isn't one, I think we duplicated the strategy that was used before the description source was available |
cf7edd5
to
211fed9
Compare
Description can come from 3 different sources:
local
central
descriptionsource
is not in the response, article has no description)Here's what I'm understanding:
If a description comes from a local source, we want to show wikitext.
If a description comes from a central source, we want to show wikidata editor.
If there is no description source, we want to show wikidata editor?
So in summary, unless a description comes from a local source, we want to show a wikidata editor?
If the above is correct, what's the point of having a list of blacklisted languages? 🤔
Or maybe if there is no description source and the language is blacklisted, we want to show wikitext?
Sample articles:
Greek language on English has a central description
Oceanography on English has a local description
Hlersu language on English has no description (no source)