Skip to content
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

Merged
merged 6 commits into from
Oct 12, 2018
Merged

Conversation

natharateh
Copy link
Contributor

@natharateh natharateh commented Oct 11, 2018

Description can come from 3 different sources:

  • local
  • central
  • none (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)

Natalia Harateh added 3 commits October 11, 2018 16:39
@@ -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;
Copy link
Contributor

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

@joewalsh
Copy link
Contributor

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?

Correct

If the above is correct, what's the point of having a list of blacklisted languages? 🤔

There isn't one, I think we duplicated the strategy that was used before the description source was available

@joewalsh joewalsh merged commit 600c5f5 into develop Oct 12, 2018
@joewalsh joewalsh deleted the bug/wikidata_api_en branch October 12, 2018 12:56
@montehurd
Copy link
Contributor

montehurd commented Oct 12, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants