Skip to content

Fixes previous PR - FIX #2918 Add option for default language for file descriptions #3020

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

Merged
merged 17 commits into from
Jun 24, 2019

Conversation

neslihanturan
Copy link
Collaborator

Description (required)

Fixes #2918 . Some minor changes are made on top of @olgalesan 's changes at #2949 . The PR was tested by me, and working in general. After my changes the issue of default language selection (before the user choose anything) which is phone local language is marked on preference list, along with its summary.

What changes did you make and why?

Previously only summary of default language was added, on the other hand none of the items on the list was selected.

Note: Reviewer should close #2949 after merging this PR

Tests performed (required)

Tested prodDebug API 26 emulator

Screenshots showing what changed (optional - for UI changes)

https://support.google.com/android/answer/9075928
image

Copy link

@pullrequest pullrequest bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ A review job has been created and sent to the PullRequest network.


Check the status or cancel PullRequest code review here.

@neslihanturan neslihanturan requested a review from misaochan June 14, 2019 13:20
@domdomegg
Copy link
Member

Doing some testing, this doesn't seem to work once uploaded. After setting default as french, the spinner appears correct but when uploaded it says the description is English:
https://commons.wikimedia.beta.wmflabs.org/wiki/File:MobileTest_3020-2.jpg

I suspect you'll need to change something in initLanguageSpinner in DescriptionsAdapter, as currently the language code is only updated when the spinner is updated and not when it is initialized.

@codecov-io
Copy link

codecov-io commented Jun 16, 2019

Codecov Report

❗ No coverage uploaded for pull request base (master@f2a499e). Click here to learn what that means.
The diff coverage is 0%.

Impacted file tree graph

@@           Coverage Diff            @@
##             master   #3020   +/-   ##
========================================
  Coverage          ?   4.41%           
========================================
  Files             ?     259           
  Lines             ?   12312           
  Branches          ?    1058           
========================================
  Hits              ?     544           
  Misses            ?   11729           
  Partials          ?      39
Impacted Files Coverage Δ
.../main/java/fr/free/nrw/commons/settings/Prefs.java 0% <ø> (ø)
...main/java/fr/free/nrw/commons/upload/Language.java 0% <ø> (ø)
...ee/nrw/commons/upload/SpinnerLanguagesAdapter.java 0% <0%> (ø)
...upload/mediaDetails/UploadMediaDetailFragment.java 0% <0%> (ø)
...r/free/nrw/commons/upload/DescriptionsAdapter.java 0% <0%> (ø)
...fr/free/nrw/commons/settings/SettingsFragment.java 0% <0%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f2a499e...c5998b4. Read the comment docs.

@neslihanturan
Copy link
Collaborator Author

Thanks for catching this @domdomegg , I never thought this pull request can effect templates will be passed after upload. Let me check

Copy link

@pullrequest pullrequest bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✖️ This code review was cancelled. See Details

@neslihanturan
Copy link
Collaborator Author

Hi @domdomegg , I was investigating this issue and recognized that this issue also exists at master branch. See my uploads from master:
Screenshot from 2019-06-18 13-18-00
Screenshot from 2019-06-18 13-17-21

I think this issue can be fixed under this same pull request though.

@neslihanturan
Copy link
Collaborator Author

neslihanturan commented Jun 18, 2019

As I logged at line

Timber.d("Description language code is: "+languageCode);
  • Language code is correctly handled on spinner. Now the remaining problem is saving this description language and adding it to template accordingly.

  • And tests should be fixed.

@domdomegg
Copy link
Member

I haven't tested this yet but I think I might not have explained the issue properly. It's not that the template is missing (that's just cause Beta commons doesn't have all of them). It's that the wrong template is applied. In the uploaded example the template is English even though the setting is set to French.

@neslihanturan
Copy link
Collaborator Author

neslihanturan commented Jun 20, 2019

Oh okay, I tested on prod. I firstly changed my default language from settings and then uploaded the picture. Apparently after my changes on init function it works:

image

Let me fix the tests and this PR will be ready.

@neslihanturan
Copy link
Collaborator Author

Actually restarting tests fixed the build too. So this PR is ready for testing.

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

Successfully merging this pull request may close these issues.

Add option for default language for file descriptions
4 participants