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

Issue 1 launguage order backend queries #5889

Conversation

Adeeth101
Copy link

Languages order preference UI and functionality enhancement.

Fixes #5826

What changes did you make and why?

Gradle Files:
Some fo the gradle code was outdated and didn't work on our latest emulators. I had to remove code that was no longer supported.

Preferences.XML:
Added a new preference category in the preferences UI for secondary language picking
Prefs.java was also changed to hold a serialised string of secondary language codes

Strings.XML:
Added new strings that represent additions in UI

SettingsFragments:

  • Had to accommodate new preference in OnCreate
  • Made a new dialog called prepareSecondaryLanguageDialog().
  • Made helper methods for that dialog that use a new language adapter SavedLanguagesAdapter
  • modified saving and getting key value methods to accommodate the new category in Prefs

NearbyController and NearbyPlaces:
Injected the KV store into the controller and passed the serialised string as a new argument to the json API client in NearbyPlaces

OkHttpJsonApiClient:
changed the getPlaces method to make use of the new parameter (the serialised language code)
made stringbuilders to automatically generate further SparQL queries based on the serialised code list
(Also modified the SparQL file itself to add placeholders for the additional strings created by the method)

Tests performed (required)
Apart from extensive manual software testing, the following unit tests were created:
StringBuilderTest.java
SettingsFragmentSecondaryLanguageTests.kt

Tested {build variant, e.g. ProdDebug} on {name of device or emulator} with API level {API level}.

Screenshots (for UI changes only)
image
image

Need help? See https://support.google.com/android/answer/9075928


Note: Please ensure that you have read CONTRIBUTING.md if this is your first pull request.

Adith101 and others added 16 commits October 12, 2024 18:41
…ult!. language!main/resources/Queries/query_for_item.rq, in retrieve item labels and descriptions.
…ult!. language!main/resources/Queries/query_for_item.rq, in retrieve item labels and descriptions.
…ult!. language!main/resources/Queries/query_for_item.rq, in retrieve item labels and descriptions.
…ult!. language!main/resources/Queries/query_for_item.rq, in retrieve item labels and descriptions.
…ult!. language!main/resources/Queries/query_for_item.rq, in retrieve item labels and descriptions.
…rder-backend-queries

# Conflicts:
#	app/src/main/resources/queries/query_for_item.rq
Copy link
Member

@nicolas-raoul nicolas-raoul left a comment

Choose a reason for hiding this comment

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

Thanks a lot!

Sorry I am outside and can't test right now.

Would you mind describing how I should do to switch German (de) and Japanese (ja)?

Any specific reason to split primary and secondary, rather than having just one list of languages? It is fine but just curious what your thoughts are om this.

@Adeeth101
Copy link
Author

Ill work on name changes and the change in the res file is unintentional sorry about that...

@nicolas-raoul
Copy link
Member

Also, please rebase or merge from master. Thanks! :-)

@Adeeth101
Copy link
Author

@nicolas-raoul Ive squashed merge conflicts and resolved above points.

@nicolas-raoul
Copy link
Member

I am so sorry for leaving it for so long, would you mind this other conflict? Thanks a lot!

@Adeeth101
Copy link
Author

Ill look into it

@Adeeth101
Copy link
Author

@nicolas-raoul Sorry again for being late. Ill fix it today.

@Adith101
Copy link

Hi @nicolas-raoul this is (@Adeeth101) im on my alt account because I'm on my phone.

A lot of the java classes I edited are now deleted and replaced kotlin versions. Not a huge deal but it does mean I basically cant auto merge and it will take some time to redo my work in kotlin. Give me another day please and thanks for the patience.

@Adeeth101
Copy link
Author

I made a new MR, which should now be good for the updated Kotlin version of the app.

@Adeeth101 Adeeth101 closed this Dec 21, 2024
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.

Languages order preference
3 participants