Skip to content

fix: the description language set to bug by default when uploading image in nearby #6221

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package fr.free.nrw.commons.nearby.model

import com.google.gson.annotations.SerializedName
import java.util.Locale

class ResultTuple {
@SerializedName("xml:lang")
Expand All @@ -15,7 +16,7 @@ class ResultTuple {
}

constructor() {
language = "bug" // Basa Ugi language - TODO Respect the `Default description language` setting.
language = Locale.getDefault().language
Copy link
Member

Choose a reason for hiding this comment

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

Please use the language configured in Settings>Default description language
Thank you!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

so i am trying to use context to access the sharedpreference and get the "descriptionDefaultLanguagePref" key but i am not able get the context. i tried getting the context in NearbyResultItem class through dependency injection but it was coming null, can you help me with this.

Copy link
Member

Choose a reason for hiding this comment

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

Performing the git bisect described in #6191 (comment) would be the best way to fix the issue. Could you please try?

Copy link
Member

Choose a reason for hiding this comment

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

@yuvraj-coder1 Did you get time to try this? Do you prefer to let someone else work on it? Thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes i fixed it.
sorry for such a late response.

video -link
https://drive.google.com/file/d/1AnqSqyStOOabibVcbxqWwINoB7P3lfGB/view?usp=sharing

i tried doing it with git bisect but was facing some issues in that because when i was going to older commits, the project was getting build errors, so i did it without that. i saw that if the language parameter is empty the logic to pick the language code set in settings was already written.

type = ""
value = ""
}
Expand Down