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

Language switcher for the Data Capture Gallery #558

Closed
wants to merge 7 commits into from

Conversation

ndegwamartin
Copy link
Collaborator

@ndegwamartin ndegwamartin commented Jun 17, 2021

Fixes #503

Description

Type
Feature

Screenshots

Screenshot_1623950930

Screenshot_1623950934

Checklist

  • I have read and acknowledged the Code of conduct
  • I have read How to Contribute
  • I have read the Developer's guide
  • I have signed the Google Individual CLA, or I am covered by my company's Corporate CLA
  • I have discussed my proposed solution with code owners in the linked issue(s) and we have agreed upon the general approach
  • I have run ./gradlew spotlessApply and ./gradlew spotlessCheck to check my code follows the style guide of this project
  • I have run ./gradlew check and ./gradlew connectedCheck to test my changes locally
  • I have built and run the reference app(s) to verify my change fixes the issue and/or does not break the reference app(s)

@google-cla
Copy link

google-cla bot commented Jun 17, 2021

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@ndegwamartin
Copy link
Collaborator Author

@googlebot I signed it!

@jingtang10
Copy link
Collaborator

Thanks @ndegwamartin :) This is really cool 😎

A note on UI: I'm not sure @fredhersch has any comment - but I would love to keep things simple to begin with. Do we have to have a navigation drawer on the left? Can we simply make this an action item on the top bar: number 4 in https://material.io/components/app-bars-top#anatomy?

@fredhersch
Copy link
Collaborator

Thanks @jingtang10 I had requested the drawer. I think it's the most logical way to show this for implementers and will be useful for other features (like syncing). If you have concerns about maintainability of the demo app using this approach let's revisit. Otherwise, I'd propose we go ahead with this. Looks great @ndegwamartin

@jingtang10
Copy link
Collaborator

spoke with @fredhersch and we think the drawer layout is probably more useful for the reference app rather than the sdc gallery app here. if it's possible to refactor please do so - thanks @ndegwamartin!

@ndegwamartin
Copy link
Collaborator Author

The Language selection dialog now pops up when you touch the action item on the right of the top app bar.

Screenshot_1625648654

Screenshot_1625648677

@ndegwamartin
Copy link
Collaborator Author

@fredhersch @jingtang10 might be worth having the first page localised in Vietnamese so that it is apparent every time one switches the language, even before getting to the questionnaires

Copy link
Collaborator

@jingtang10 jingtang10 left a comment

Choose a reason for hiding this comment

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

Thanks @ndegwamartin!

language: LanguageSwitcherUtils.Language,
context: Activity
) {

Copy link
Collaborator

Choose a reason for hiding this comment

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

remove new line

Copy link
Collaborator

Choose a reason for hiding this comment

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

this isn't done

@ndegwamartin ndegwamartin force-pushed the mn/503-language-switcher branch 4 times, most recently from 9a97cba to d9751d7 Compare July 12, 2021 10:16
@Tarun-Bhardwaj
Copy link

Hi @ndegwamartin , is there an ETA you can provide for completing the changes as per the review comments in order to close this PR?

@ndegwamartin
Copy link
Collaborator Author

Hi @ndegwamartin , is there an ETA you can provide for completing the changes as per the review comments in order to close this PR?

@Tarun-Bhardwaj all changes requested are complete

@ndegwamartin
Copy link
Collaborator Author

@deepankarb please check out the updates

@ndegwamartin ndegwamartin force-pushed the mn/503-language-switcher branch 2 times, most recently from 3452b6d to ca6a6a4 Compare July 26, 2021 12:11
@Tarun-Bhardwaj
Copy link

@deepankarb , it seems Martin has completed all changes as per review comments. Could you please re-review the same?

@codecov-commenter
Copy link

codecov-commenter commented Aug 26, 2021

Codecov Report

Merging #558 (c0b966c) into master (6084de7) will increase coverage by 0.01%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #558      +/-   ##
============================================
+ Coverage     88.78%   88.79%   +0.01%     
  Complexity      464      464              
============================================
  Files           106      106              
  Lines          9089     9089              
  Branches        579      579              
============================================
+ Hits           8070     8071       +1     
+ Misses          714      713       -1     
  Partials        305      305              
Impacted Files Coverage Δ
...va/com/google/android/fhir/db/impl/DatabaseImpl.kt 85.45% <0.00%> (+1.81%) ⬆️

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 6084de7...c0b966c. Read the comment docs.

@Tarun-Bhardwaj Tarun-Bhardwaj added this to In progress in Data capture library via automation Sep 15, 2021
@ndegwamartin ndegwamartin force-pushed the mn/503-language-switcher branch 3 times, most recently from d8c113d to 248b340 Compare November 12, 2021 07:18
- Add language switcher to demo internationalization in the sdc lib
- Vietnamese localization
- Remove Navigation Drawer
- Add language selection as an Action item
@ndegwamartin ndegwamartin enabled auto-merge (squash) November 23, 2021 14:20
@jingtang10 jingtang10 self-requested a review November 23, 2021 14:57
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
binding = ActivityMainBinding.inflate(layoutInflater)
setContentView(binding.root)

Copy link
Collaborator

Choose a reason for hiding this comment

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

remove new line


override fun onCreateOptionsMenu(menu: Menu): Boolean {
menuInflater.inflate(R.menu.top_bar_menu, menu)

Copy link
Collaborator

Choose a reason for hiding this comment

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

remove new line

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
binding = ActivityMainBinding.inflate(layoutInflater)
setContentView(binding.root)

languageList = LocaleUtils.getLanguageList(this)
Copy link
Collaborator

Choose a reason for hiding this comment

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

can this line be on line 31?

@jingtang10
Copy link
Collaborator

jingtang10 commented Nov 26, 2021

Following our discussion yesterday @ndegwamartin I closed this issue #503 (comment). Will you please close this PR if this sounds good to you? Thanks for the good work and I hope the learnings here have been useful in fhir core!

@ndegwamartin
Copy link
Collaborator Author

Following our discussion yesterday @ndegwamartin I closed this issue #503 (comment). Will you please close this PR if this sounds good to you? Thanks for the good work and I hope the learnings here have been useful in fhir core!

Yeah I've learnt a alot. Closing this now

auto-merge was automatically disabled November 26, 2021 11:12

Pull request was closed

Data capture library automation moved this from In progress to Done Nov 26, 2021
@jingtang10 jingtang10 deleted the mn/503-language-switcher branch April 16, 2022 12:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Set locale from within app: support multi language app
6 participants