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 selection screen [Blocked: #20, #44] #52

Closed
BenHenning opened this issue Aug 2, 2019 · 8 comments · Fixed by #5010
Closed

Language selection screen [Blocked: #20, #44] #52

BenHenning opened this issue Aug 2, 2019 · 8 comments · Fixed by #5010
Assignees
Labels
enhancement End user-perceivable enhancements. Impact: Medium Moderate perceived user impact (non-blocking bugs and general improvements). Issue: Needs Break-down Indicates that an issue is too large and should be broken into smaller chunks. Issue: Needs Clarification Indicates that an issue needs more detail in order to be able to be acted upon. Priority: Nice-to-have This work item is nice to have for its milestone. Work: Medium The means to find the solution is clear, but it isn't at good-first-issue level yet. Z-ibt Temporary label for Ben to keep track of issues he's triaged.

Comments

@BenHenning
Copy link
Member

There needs to be a page where the user can view all languages that the Oppia app supports and select which on it should be displayed in. This should be a per-profile setting that sets the language for the app, but not for the whole system. It should be easy to navigate to this screen. It should also be possible for the user to change the language only for the profile selection page temporarily as they log in. See the PRD for specifics.

@BenHenning BenHenning added Type: Improvement Priority: Nice-to-have This work item is nice to have for its milestone. labels Aug 2, 2019
@BenHenning BenHenning added this to the Prototype milestone Aug 2, 2019
@BenHenning
Copy link
Member Author

This is blocked by #20 and #44 (for where the language selection screen will be displayed).

@BenHenning BenHenning changed the title Language selection screen Language selection screen [Blocked: #20, #44] Aug 12, 2019
@BenHenning BenHenning modified the milestones: Prototype -- UI, Minimal Viable Product Sep 17, 2019
@BenHenning BenHenning modified the milestones: Minimal Viable Product, Global Availability, Beta Jun 23, 2020
@anandwana001
Copy link
Contributor

Now we do have a screen where we can see all the languages.
Things left to do:

  1. Check and fix if the app is updating according to the selected language or not

BenHenning added a commit that referenced this issue Sep 15, 2021
Flag status is off by default until #52 is finished.
BenHenning added a commit that referenced this issue Oct 6, 2021
…patterns, and other miscellaneous alpha MR3 fixes (#3797)

* Add support for AABs, build flavors, and proguard.

There are a lot of details to cover here--see the PR for the complete
context.

* Lint & codeowner fixes.

* Fix failures.

- Add missing codeowner
- Add support for configuring base branch reference
- Update CI for dev/alpha AAB builds to use 'develop' since there's no
  origin configured by default in the workflows

* Different attempt to fix bad develop reference in CI.

* Initial commit.

This is needed to open a PR on GitHub. This commit is being made so that
the PR can start off in a broken Actions state.

This also initially disables most non-Bazel workflows to make workflow
iteration faster and less impacting on other team members.

* Introduce infrastructure for batching.

This introduces a new mechanism for passing lists of tests to sharded
test targets in CI, and hooks it up. No actual sharding is occurring
yet. This led to some simplifications in the CI workflow since the
script can be more dynamic in computing the full list of targets (which
also works around a previous bug with instrumentation tests being run).
Java proto lite also needed to be upgraded for the scripts to be able to
use it.

More testing/documentation needed as this functionality continues to
expand.

* Add bucketing strategy.

This simply partitions bucketed groups of targets into chunks of 10 for
each run. Only 3 buckets are currently retained to test sharding in CI
before introducing full support.

* Fix caching & stabilize builds.

Fixes some caching bucket and output bugs. Also, introduces while loop &
keep_going to introduce resilience against app test build failures (or
just test failures in general).

* Increase sharding & add randomization.

Also, enable other workflows.

Note that CI shouldn't fully pass yet since some documentation and
testing needs to be added yet, but this is meant to be a more realistic
test of the CI environment before the PR is finished.

* Improving partitionin & readability.

Adds a human-readable prefix to make the shards look a bit nicer.

Also, adds more fine-tuned partitioning to bucket & reduce shard counts
to improve overall timing. Will need to be tested in CI.

* Add new tests & fix static analysis errors.

* Fix script.

A newly computed variable wasn't updated to be used in an earlier
change.

* Fix broken tests & test configuration.

Add docstrings for proto.

* Fix mistake from earlier commit.

* Try 10 max parallel actions instead.

See
#3757 (comment)
for context.

* Fix another error from an earlier commit.

* Localisation updates from https://translatewiki.net.

* Fix mv command so it works on Linux & OSX.

Neither 'mv -t' nor piping to mv work on OSX so we needed to find an
alternative (in this case just trying to move everything). This actually
works a bit better since it's doing a per-file move rather than
accommodating for files that shouldn't be moved (which isn't an issue
since the destination directory is different than the one containing the
AAB file).

* Introduce initial domain layer for translations.

Documentation, thorough tests, and detailed description of these changes
are still needed.

* Initial app layer implementation for translations.

This demonstrates working string selection for system-based and
overwritten app languages, including necessary activity recreation &
layout direction overwriting.

This also includes a bunch of Dagger infra refactoring so that some app
layer packages can now be modularized (including the new packages).

* Domain changes needed per downstream UI changes.

* Add patterns & fixes.

This involves MANY broad changes to ensure consistent string retrieval
(for arrays and plurals), formatting, and string transformations
throughout the codebase. Some extra patterns to added to fix things that
were needed, and a few issues were fixed along the way.

* Add needed domain changes for downstream branch.

Also includes fixing circular dependency issue by splitting out some of
the locale components to be part of utility rather than domain (so that
utiltiy and other packages can depend on MachineLocale).

* Introduce support for content localization.

This includes a bunch of stuff that'll be described in more detail in
the PR description, but it essentially:
- Adds support for displaying content in explorations, questions,
  concept cards, and revision cards in a non-English language
- Adds support for submitting non-English answers
- Updates test structures to validate everything exception questions is
  working for localization

* Fix structures to work with parsing assumptions.

* Fix regex checks for translated strings.

Also, performance improvements for the regex check.

* Lint-ish fix.

* Fix failing regex checks.

* Add check for nested res subdirectories.

* Add remaining regex patterns & fixes.

* Clean up locale infra.

Add some other needed functionality.

* Attempt to delete strings to force history.

* Gate options behind compile-time flag.

Flag status is off by default until #52 is finished.

* Proguard fixes for Glide.

Update version code since 6 & 7 were shipped.

* Make AAB builds/runs manual-only targets.

* Fix broken tests.

* Fix lint issues & add KDocs.

Also, abstract ContentLocale for consistency & to disallow direct
construction.

* Add 6/11 test suites (& placeholders for other 4).

Silence one file missing a test suite (since it doesn't need one).

Also, some tweaks to the language support definitions.

* Add more test suites for domain layers.

Included introducing a new general purpose utility for testing data
providers + its own test suite.

* Introduce wrapper & fake for bidi wrapping.

Also, add test version of AssetRepository.

Add new placeholder tests & update all tests project-wide to make sure
that they build.

* Add remaining tests.

Included some shadow refactoring, and introducing new test-only
resources.

* Fix Gradle builds.

* Lint fixes.

* Resolve remaining incomplete TODOs.

* Add new codeowners.

* Post-merge fixes.

Make all non-app layer targets build (haven't run tests yet).

Audited existing bidi wrapping cases & converted strings over to being
%s-only.

* Fix most test targets (builds).

All non-app tests confirmed as passing.

* Fix all remaining test builds.

Introduce new TestActivity for scaffolding all non-activity tests.

* Fix all app layer tests.

Add fixes for question player & old answer displaying.

Add fix for guaranteed crash on startup after some changes between now &
the first build of MR3 (dueu to extra updates in
SplashActivityPresenter).

* Fix questions & profile issues.

* Type specifier pattern & fixes.

Address temporary TODO by removing kdoc.

* Add missing KDocs.

* Boilerplate & TODOs for needed tests.

* Add new needed test dep.

Required an update to truth proto lite import (due to an incompatible
update in the common Truth dep).

* Add needed testing coverage.

Other miscellaneous fixes needed to support new tests.

* Two fixes.

1. Introduce proper API compatibility for LocaleController
2. Ensure TranslationController is scoped (breaks test in downstream PR)

* Fix Gradle builds on branch.

* Resolve nearly all pending TODOs.

Only remainder is a test suite whose tests need to be migrated.

* Lint fixes.

* Re-add method removed from merge.

* Lint fixes.

This also fixes broken extra/unused imports from the merge.

Verified that the dev build works as of this commit. Haven't verified
anything else.

* Fix compute affected tests script.

Adds support for very large PR changesets.

* Fix failures found on CI.

* Fix remaining Gradle failures found in CI.

* Fix existing domain + app layer tests.

Some reworking was needed in QuestionAssessmentProgressControllerTest.

* Post-merge fix.

* Gradle Espresso test fix.

* Add missing KDocs, remove extra file, and other cleanups.

* Lint fixes.

* Fix CI & lint checks (except regex).

* Deflake DataProviderTestMonitorTest.

* Address reviewer comments.

* Lint fixes.

* Fix affected tests from earlier changes.

These failures were found from CI test workflows.

* Fix remaining Gradle failures.

This introduces a proper fallback mechanism for content strings that
allows Gradle builds & tests to work properly, and adds more robustness
in case misconfigurations actually happen.

* Add placeholders for new needed tests.

* Fix broken tests.

This came from the earlier commit's fix--the suite hadn't been updated.

* Add needed tests for new behaviors.

* Fix Gradle build & mechanism change failures.

* Lint fixes.

* Undo inadvertent change to Gradle jvmargs.

* Disable most tests on Espresso.

* Test fixes + make monitor Espresso-compatible.

* Fix broken tests.

Refactor how platform parameter module.

Add new options fragment tests.

* Add exemptions & regex check tests.

* Lint fixes.

* Lint fixes.

* Fix broken tests (per CI).

Co-authored-by: translatewiki.net <[email protected]>
BenHenning added a commit that referenced this issue Oct 6, 2021
* Add support for AABs, build flavors, and proguard.

There are a lot of details to cover here--see the PR for the complete
context.

* Lint & codeowner fixes.

* Fix failures.

- Add missing codeowner
- Add support for configuring base branch reference
- Update CI for dev/alpha AAB builds to use 'develop' since there's no
  origin configured by default in the workflows

* Different attempt to fix bad develop reference in CI.

* Initial commit.

This is needed to open a PR on GitHub. This commit is being made so that
the PR can start off in a broken Actions state.

This also initially disables most non-Bazel workflows to make workflow
iteration faster and less impacting on other team members.

* Introduce infrastructure for batching.

This introduces a new mechanism for passing lists of tests to sharded
test targets in CI, and hooks it up. No actual sharding is occurring
yet. This led to some simplifications in the CI workflow since the
script can be more dynamic in computing the full list of targets (which
also works around a previous bug with instrumentation tests being run).
Java proto lite also needed to be upgraded for the scripts to be able to
use it.

More testing/documentation needed as this functionality continues to
expand.

* Add bucketing strategy.

This simply partitions bucketed groups of targets into chunks of 10 for
each run. Only 3 buckets are currently retained to test sharding in CI
before introducing full support.

* Fix caching & stabilize builds.

Fixes some caching bucket and output bugs. Also, introduces while loop &
keep_going to introduce resilience against app test build failures (or
just test failures in general).

* Increase sharding & add randomization.

Also, enable other workflows.

Note that CI shouldn't fully pass yet since some documentation and
testing needs to be added yet, but this is meant to be a more realistic
test of the CI environment before the PR is finished.

* Improving partitionin & readability.

Adds a human-readable prefix to make the shards look a bit nicer.

Also, adds more fine-tuned partitioning to bucket & reduce shard counts
to improve overall timing. Will need to be tested in CI.

* Add new tests & fix static analysis errors.

* Fix script.

A newly computed variable wasn't updated to be used in an earlier
change.

* Fix broken tests & test configuration.

Add docstrings for proto.

* Fix mistake from earlier commit.

* Try 10 max parallel actions instead.

See
#3757 (comment)
for context.

* Fix another error from an earlier commit.

* Localisation updates from https://translatewiki.net.

* Fix mv command so it works on Linux & OSX.

Neither 'mv -t' nor piping to mv work on OSX so we needed to find an
alternative (in this case just trying to move everything). This actually
works a bit better since it's doing a per-file move rather than
accommodating for files that shouldn't be moved (which isn't an issue
since the destination directory is different than the one containing the
AAB file).

* Introduce initial domain layer for translations.

Documentation, thorough tests, and detailed description of these changes
are still needed.

* Initial app layer implementation for translations.

This demonstrates working string selection for system-based and
overwritten app languages, including necessary activity recreation &
layout direction overwriting.

This also includes a bunch of Dagger infra refactoring so that some app
layer packages can now be modularized (including the new packages).

* Domain changes needed per downstream UI changes.

* Add patterns & fixes.

This involves MANY broad changes to ensure consistent string retrieval
(for arrays and plurals), formatting, and string transformations
throughout the codebase. Some extra patterns to added to fix things that
were needed, and a few issues were fixed along the way.

* Add needed domain changes for downstream branch.

Also includes fixing circular dependency issue by splitting out some of
the locale components to be part of utility rather than domain (so that
utiltiy and other packages can depend on MachineLocale).

* Introduce support for content localization.

This includes a bunch of stuff that'll be described in more detail in
the PR description, but it essentially:
- Adds support for displaying content in explorations, questions,
  concept cards, and revision cards in a non-English language
- Adds support for submitting non-English answers
- Updates test structures to validate everything exception questions is
  working for localization

* Fix structures to work with parsing assumptions.

* Fix regex checks for translated strings.

Also, performance improvements for the regex check.

* Lint-ish fix.

* Fix failing regex checks.

* Add check for nested res subdirectories.

* Add remaining regex patterns & fixes.

* Clean up locale infra.

Add some other needed functionality.

* Attempt to delete strings to force history.

* Gate options behind compile-time flag.

Flag status is off by default until #52 is finished.

* Proguard fixes for Glide.

Update version code since 6 & 7 were shipped.

* Make AAB builds/runs manual-only targets.

* Fix broken tests.

* Fix lint issues & add KDocs.

Also, abstract ContentLocale for consistency & to disallow direct
construction.

* Add 6/11 test suites (& placeholders for other 4).

Silence one file missing a test suite (since it doesn't need one).

Also, some tweaks to the language support definitions.

* Add more test suites for domain layers.

Included introducing a new general purpose utility for testing data
providers + its own test suite.

* Introduce wrapper & fake for bidi wrapping.

Also, add test version of AssetRepository.

Add new placeholder tests & update all tests project-wide to make sure
that they build.

* Add remaining tests.

Included some shadow refactoring, and introducing new test-only
resources.

* Fix Gradle builds.

* Lint fixes.

* Resolve remaining incomplete TODOs.

* Add new codeowners.

* Post-merge fixes.

Make all non-app layer targets build (haven't run tests yet).

Audited existing bidi wrapping cases & converted strings over to being
%s-only.

* Fix most test targets (builds).

All non-app tests confirmed as passing.

* Fix all remaining test builds.

Introduce new TestActivity for scaffolding all non-activity tests.

* Fix all app layer tests.

Add fixes for question player & old answer displaying.

Add fix for guaranteed crash on startup after some changes between now &
the first build of MR3 (dueu to extra updates in
SplashActivityPresenter).

* Fix questions & profile issues.

* Type specifier pattern & fixes.

Address temporary TODO by removing kdoc.

* Add missing KDocs.

* Boilerplate & TODOs for needed tests.

* Add new needed test dep.

Required an update to truth proto lite import (due to an incompatible
update in the common Truth dep).

* Add needed testing coverage.

Other miscellaneous fixes needed to support new tests.

* Two fixes.

1. Introduce proper API compatibility for LocaleController
2. Ensure TranslationController is scoped (breaks test in downstream PR)

* Fix Gradle builds on branch.

* Resolve nearly all pending TODOs.

Only remainder is a test suite whose tests need to be migrated.

* Lint fixes.

* Re-add method removed from merge.

* Lint fixes.

This also fixes broken extra/unused imports from the merge.

Verified that the dev build works as of this commit. Haven't verified
anything else.

* Fix compute affected tests script.

Adds support for very large PR changesets.

* Fix failures found on CI.

* Fix remaining Gradle failures found in CI.

* Fix existing domain + app layer tests.

Some reworking was needed in QuestionAssessmentProgressControllerTest.

* Post-merge fix.

* Gradle Espresso test fix.

* Add missing KDocs, remove extra file, and other cleanups.

* Lint fixes.

* Fix CI & lint checks (except regex).

* Deflake DataProviderTestMonitorTest.

* Address reviewer comments.

* Lint fixes.

* Fix affected tests from earlier changes.

These failures were found from CI test workflows.

* Fix remaining Gradle failures.

This introduces a proper fallback mechanism for content strings that
allows Gradle builds & tests to work properly, and adds more robustness
in case misconfigurations actually happen.

* Add placeholders for new needed tests.

* Fix broken tests.

This came from the earlier commit's fix--the suite hadn't been updated.

* Add needed tests for new behaviors.

* Fix Gradle build & mechanism change failures.

* Lint fixes.

* Undo inadvertent change to Gradle jvmargs.

* Disable most tests on Espresso.

* Test fixes + make monitor Espresso-compatible.

* Fix broken tests.

Refactor how platform parameter module.

Add new options fragment tests.

* Add exemptions & regex check tests.

* Lint fixes.

* Lint fixes.

* Add new ratio input rule classifier.

* Fix broken tests (per CI).

Co-authored-by: translatewiki.net <[email protected]>
BenHenning added a commit that referenced this issue Oct 7, 2021
…cess death in low memory cases (#3860)

* Add support for AABs, build flavors, and proguard.

There are a lot of details to cover here--see the PR for the complete
context.

* Lint & codeowner fixes.

* Fix failures.

- Add missing codeowner
- Add support for configuring base branch reference
- Update CI for dev/alpha AAB builds to use 'develop' since there's no
  origin configured by default in the workflows

* Different attempt to fix bad develop reference in CI.

* Initial commit.

This is needed to open a PR on GitHub. This commit is being made so that
the PR can start off in a broken Actions state.

This also initially disables most non-Bazel workflows to make workflow
iteration faster and less impacting on other team members.

* Introduce infrastructure for batching.

This introduces a new mechanism for passing lists of tests to sharded
test targets in CI, and hooks it up. No actual sharding is occurring
yet. This led to some simplifications in the CI workflow since the
script can be more dynamic in computing the full list of targets (which
also works around a previous bug with instrumentation tests being run).
Java proto lite also needed to be upgraded for the scripts to be able to
use it.

More testing/documentation needed as this functionality continues to
expand.

* Add bucketing strategy.

This simply partitions bucketed groups of targets into chunks of 10 for
each run. Only 3 buckets are currently retained to test sharding in CI
before introducing full support.

* Fix caching & stabilize builds.

Fixes some caching bucket and output bugs. Also, introduces while loop &
keep_going to introduce resilience against app test build failures (or
just test failures in general).

* Increase sharding & add randomization.

Also, enable other workflows.

Note that CI shouldn't fully pass yet since some documentation and
testing needs to be added yet, but this is meant to be a more realistic
test of the CI environment before the PR is finished.

* Improving partitionin & readability.

Adds a human-readable prefix to make the shards look a bit nicer.

Also, adds more fine-tuned partitioning to bucket & reduce shard counts
to improve overall timing. Will need to be tested in CI.

* Add new tests & fix static analysis errors.

* Fix script.

A newly computed variable wasn't updated to be used in an earlier
change.

* Fix broken tests & test configuration.

Add docstrings for proto.

* Fix mistake from earlier commit.

* Try 10 max parallel actions instead.

See
#3757 (comment)
for context.

* Fix another error from an earlier commit.

* Localisation updates from https://translatewiki.net.

* Fix mv command so it works on Linux & OSX.

Neither 'mv -t' nor piping to mv work on OSX so we needed to find an
alternative (in this case just trying to move everything). This actually
works a bit better since it's doing a per-file move rather than
accommodating for files that shouldn't be moved (which isn't an issue
since the destination directory is different than the one containing the
AAB file).

* Introduce initial domain layer for translations.

Documentation, thorough tests, and detailed description of these changes
are still needed.

* Initial app layer implementation for translations.

This demonstrates working string selection for system-based and
overwritten app languages, including necessary activity recreation &
layout direction overwriting.

This also includes a bunch of Dagger infra refactoring so that some app
layer packages can now be modularized (including the new packages).

* Domain changes needed per downstream UI changes.

* Add patterns & fixes.

This involves MANY broad changes to ensure consistent string retrieval
(for arrays and plurals), formatting, and string transformations
throughout the codebase. Some extra patterns to added to fix things that
were needed, and a few issues were fixed along the way.

* Add needed domain changes for downstream branch.

Also includes fixing circular dependency issue by splitting out some of
the locale components to be part of utility rather than domain (so that
utiltiy and other packages can depend on MachineLocale).

* Introduce support for content localization.

This includes a bunch of stuff that'll be described in more detail in
the PR description, but it essentially:
- Adds support for displaying content in explorations, questions,
  concept cards, and revision cards in a non-English language
- Adds support for submitting non-English answers
- Updates test structures to validate everything exception questions is
  working for localization

* Fix structures to work with parsing assumptions.

* Fix regex checks for translated strings.

Also, performance improvements for the regex check.

* Lint-ish fix.

* Fix failing regex checks.

* Add check for nested res subdirectories.

* Add remaining regex patterns & fixes.

* Clean up locale infra.

Add some other needed functionality.

* Attempt to delete strings to force history.

* Gate options behind compile-time flag.

Flag status is off by default until #52 is finished.

* Proguard fixes for Glide.

Update version code since 6 & 7 were shipped.

* Make AAB builds/runs manual-only targets.

* Fix broken tests.

* Fix lint issues & add KDocs.

Also, abstract ContentLocale for consistency & to disallow direct
construction.

* Add 6/11 test suites (& placeholders for other 4).

Silence one file missing a test suite (since it doesn't need one).

Also, some tweaks to the language support definitions.

* Add more test suites for domain layers.

Included introducing a new general purpose utility for testing data
providers + its own test suite.

* Introduce wrapper & fake for bidi wrapping.

Also, add test version of AssetRepository.

Add new placeholder tests & update all tests project-wide to make sure
that they build.

* Add remaining tests.

Included some shadow refactoring, and introducing new test-only
resources.

* Fix Gradle builds.

* Lint fixes.

* Resolve remaining incomplete TODOs.

* Add new codeowners.

* Post-merge fixes.

Make all non-app layer targets build (haven't run tests yet).

Audited existing bidi wrapping cases & converted strings over to being
%s-only.

* Fix most test targets (builds).

All non-app tests confirmed as passing.

* Fix all remaining test builds.

Introduce new TestActivity for scaffolding all non-activity tests.

* Fix all app layer tests.

Add fixes for question player & old answer displaying.

Add fix for guaranteed crash on startup after some changes between now &
the first build of MR3 (dueu to extra updates in
SplashActivityPresenter).

* Fix questions & profile issues.

* Type specifier pattern & fixes.

Address temporary TODO by removing kdoc.

* Add missing KDocs.

* Boilerplate & TODOs for needed tests.

* Add new needed test dep.

Required an update to truth proto lite import (due to an incompatible
update in the common Truth dep).

* Add needed testing coverage.

Other miscellaneous fixes needed to support new tests.

* Two fixes.

1. Introduce proper API compatibility for LocaleController
2. Ensure TranslationController is scoped (breaks test in downstream PR)

* Fix Gradle builds on branch.

* Resolve nearly all pending TODOs.

Only remainder is a test suite whose tests need to be migrated.

* Lint fixes.

* Re-add method removed from merge.

* Lint fixes.

This also fixes broken extra/unused imports from the merge.

Verified that the dev build works as of this commit. Haven't verified
anything else.

* Fix compute affected tests script.

Adds support for very large PR changesets.

* Fix failures found on CI.

* Fix remaining Gradle failures found in CI.

* Fix existing domain + app layer tests.

Some reworking was needed in QuestionAssessmentProgressControllerTest.

* Post-merge fix.

* Gradle Espresso test fix.

* Add missing KDocs, remove extra file, and other cleanups.

* Lint fixes.

* Fix CI & lint checks (except regex).

* Deflake DataProviderTestMonitorTest.

* Address reviewer comments.

* Lint fixes.

* Fix affected tests from earlier changes.

These failures were found from CI test workflows.

* Fix remaining Gradle failures.

This introduces a proper fallback mechanism for content strings that
allows Gradle builds & tests to work properly, and adds more robustness
in case misconfigurations actually happen.

* Add placeholders for new needed tests.

* Fix broken tests.

This came from the earlier commit's fix--the suite hadn't been updated.

* Add needed tests for new behaviors.

* Fix Gradle build & mechanism change failures.

* Lint fixes.

* Undo inadvertent change to Gradle jvmargs.

* Disable most tests on Espresso.

* Test fixes + make monitor Espresso-compatible.

* Fix broken tests.

Refactor how platform parameter module.

Add new options fragment tests.

* Add exemptions & regex check tests.

* Lint fixes.

* Lint fixes.

* Add new ratio input rule classifier.

* Fix broken tests (per CI).

* Add mechanism to recover from crashes.

* Remove malformed TODO.

Co-authored-by: translatewiki.net <[email protected]>
BenHenning added a commit that referenced this issue Oct 7, 2021
* Add support for AABs, build flavors, and proguard.

There are a lot of details to cover here--see the PR for the complete
context.

* Lint & codeowner fixes.

* Fix failures.

- Add missing codeowner
- Add support for configuring base branch reference
- Update CI for dev/alpha AAB builds to use 'develop' since there's no
  origin configured by default in the workflows

* Different attempt to fix bad develop reference in CI.

* Initial commit.

This is needed to open a PR on GitHub. This commit is being made so that
the PR can start off in a broken Actions state.

This also initially disables most non-Bazel workflows to make workflow
iteration faster and less impacting on other team members.

* Introduce infrastructure for batching.

This introduces a new mechanism for passing lists of tests to sharded
test targets in CI, and hooks it up. No actual sharding is occurring
yet. This led to some simplifications in the CI workflow since the
script can be more dynamic in computing the full list of targets (which
also works around a previous bug with instrumentation tests being run).
Java proto lite also needed to be upgraded for the scripts to be able to
use it.

More testing/documentation needed as this functionality continues to
expand.

* Add bucketing strategy.

This simply partitions bucketed groups of targets into chunks of 10 for
each run. Only 3 buckets are currently retained to test sharding in CI
before introducing full support.

* Fix caching & stabilize builds.

Fixes some caching bucket and output bugs. Also, introduces while loop &
keep_going to introduce resilience against app test build failures (or
just test failures in general).

* Increase sharding & add randomization.

Also, enable other workflows.

Note that CI shouldn't fully pass yet since some documentation and
testing needs to be added yet, but this is meant to be a more realistic
test of the CI environment before the PR is finished.

* Improving partitionin & readability.

Adds a human-readable prefix to make the shards look a bit nicer.

Also, adds more fine-tuned partitioning to bucket & reduce shard counts
to improve overall timing. Will need to be tested in CI.

* Add new tests & fix static analysis errors.

* Fix script.

A newly computed variable wasn't updated to be used in an earlier
change.

* Fix broken tests & test configuration.

Add docstrings for proto.

* Fix mistake from earlier commit.

* Try 10 max parallel actions instead.

See
#3757 (comment)
for context.

* Fix another error from an earlier commit.

* Localisation updates from https://translatewiki.net.

* Fix mv command so it works on Linux & OSX.

Neither 'mv -t' nor piping to mv work on OSX so we needed to find an
alternative (in this case just trying to move everything). This actually
works a bit better since it's doing a per-file move rather than
accommodating for files that shouldn't be moved (which isn't an issue
since the destination directory is different than the one containing the
AAB file).

* Introduce initial domain layer for translations.

Documentation, thorough tests, and detailed description of these changes
are still needed.

* Initial app layer implementation for translations.

This demonstrates working string selection for system-based and
overwritten app languages, including necessary activity recreation &
layout direction overwriting.

This also includes a bunch of Dagger infra refactoring so that some app
layer packages can now be modularized (including the new packages).

* Domain changes needed per downstream UI changes.

* Add patterns & fixes.

This involves MANY broad changes to ensure consistent string retrieval
(for arrays and plurals), formatting, and string transformations
throughout the codebase. Some extra patterns to added to fix things that
were needed, and a few issues were fixed along the way.

* Add needed domain changes for downstream branch.

Also includes fixing circular dependency issue by splitting out some of
the locale components to be part of utility rather than domain (so that
utiltiy and other packages can depend on MachineLocale).

* Introduce support for content localization.

This includes a bunch of stuff that'll be described in more detail in
the PR description, but it essentially:
- Adds support for displaying content in explorations, questions,
  concept cards, and revision cards in a non-English language
- Adds support for submitting non-English answers
- Updates test structures to validate everything exception questions is
  working for localization

* Fix structures to work with parsing assumptions.

* Fix regex checks for translated strings.

Also, performance improvements for the regex check.

* Lint-ish fix.

* Fix failing regex checks.

* Add check for nested res subdirectories.

* Add remaining regex patterns & fixes.

* Clean up locale infra.

Add some other needed functionality.

* Attempt to delete strings to force history.

* Gate options behind compile-time flag.

Flag status is off by default until #52 is finished.

* Proguard fixes for Glide.

Update version code since 6 & 7 were shipped.

* Make AAB builds/runs manual-only targets.

* Fix broken tests.

* Fix lint issues & add KDocs.

Also, abstract ContentLocale for consistency & to disallow direct
construction.

* Add 6/11 test suites (& placeholders for other 4).

Silence one file missing a test suite (since it doesn't need one).

Also, some tweaks to the language support definitions.

* Add more test suites for domain layers.

Included introducing a new general purpose utility for testing data
providers + its own test suite.

* Introduce wrapper & fake for bidi wrapping.

Also, add test version of AssetRepository.

Add new placeholder tests & update all tests project-wide to make sure
that they build.

* Add remaining tests.

Included some shadow refactoring, and introducing new test-only
resources.

* Fix Gradle builds.

* Lint fixes.

* Resolve remaining incomplete TODOs.

* Add new codeowners.

* Post-merge fixes.

Make all non-app layer targets build (haven't run tests yet).

Audited existing bidi wrapping cases & converted strings over to being
%s-only.

* Fix most test targets (builds).

All non-app tests confirmed as passing.

* Fix all remaining test builds.

Introduce new TestActivity for scaffolding all non-activity tests.

* Fix all app layer tests.

Add fixes for question player & old answer displaying.

Add fix for guaranteed crash on startup after some changes between now &
the first build of MR3 (dueu to extra updates in
SplashActivityPresenter).

* Fix questions & profile issues.

* Type specifier pattern & fixes.

Address temporary TODO by removing kdoc.

* Add missing KDocs.

* Boilerplate & TODOs for needed tests.

* Add new needed test dep.

Required an update to truth proto lite import (due to an incompatible
update in the common Truth dep).

* Add needed testing coverage.

Other miscellaneous fixes needed to support new tests.

* Two fixes.

1. Introduce proper API compatibility for LocaleController
2. Ensure TranslationController is scoped (breaks test in downstream PR)

* Fix Gradle builds on branch.

* Resolve nearly all pending TODOs.

Only remainder is a test suite whose tests need to be migrated.

* Lint fixes.

* Re-add method removed from merge.

* Lint fixes.

This also fixes broken extra/unused imports from the merge.

Verified that the dev build works as of this commit. Haven't verified
anything else.

* Fix compute affected tests script.

Adds support for very large PR changesets.

* Fix failures found on CI.

* Fix remaining Gradle failures found in CI.

* Fix existing domain + app layer tests.

Some reworking was needed in QuestionAssessmentProgressControllerTest.

* Post-merge fix.

* Gradle Espresso test fix.

* Add missing KDocs, remove extra file, and other cleanups.

* Lint fixes.

* Fix CI & lint checks (except regex).

* Deflake DataProviderTestMonitorTest.

* Address reviewer comments.

* Lint fixes.

* Fix affected tests from earlier changes.

These failures were found from CI test workflows.

* Fix remaining Gradle failures.

This introduces a proper fallback mechanism for content strings that
allows Gradle builds & tests to work properly, and adds more robustness
in case misconfigurations actually happen.

* Add placeholders for new needed tests.

* Fix broken tests.

This came from the earlier commit's fix--the suite hadn't been updated.

* Add needed tests for new behaviors.

* Fix Gradle build & mechanism change failures.

* Lint fixes.

* Undo inadvertent change to Gradle jvmargs.

* Disable most tests on Espresso.

* Test fixes + make monitor Espresso-compatible.

* Fix broken tests.

Refactor how platform parameter module.

Add new options fragment tests.

* Add exemptions & regex check tests.

* Lint fixes.

* Lint fixes.

* Add new ratio input rule classifier.

* Fix broken tests (per CI).

* Add mechanism to recover from crashes.

* Remove malformed TODO.

* Add Proguard rules needed to fix splash issue.

See PR & related issue for more context.

* Update LocaleController.kt

Remove TODO on #3800 since it's been resolved.

Co-authored-by: translatewiki.net <[email protected]>
@BenHenning
Copy link
Member Author

This is a duplicate of #4606 (which is now tracking the request for functionality from the product team).

@BenHenning BenHenning closed this as not planned Won't fix, can't repro, duplicate, stale Dec 23, 2022
Repository owner moved this from Todo to Done in [Team] Core Learner and Mastery flows & UI Frontend - Android Dec 23, 2022
@github-actions github-actions bot reopened this Dec 23, 2022
Repository owner moved this from Done to In Progress in [Team] Core Learner and Mastery flows & UI Frontend - Android Dec 23, 2022
@github-actions
Copy link

The issue is reopened because of the following unresolved TODOs:

// TODO(#52): Hook this up properly to profiles, and handle the non-profile activity cases.

// TODO(#52): Finish this implementation. The implementation below doesn't actually save/restore

// TODO(#52): Enable this feature by default once it's completed.

@BenHenning
Copy link
Member Author

@KevinGitonga I think you'll need to make sure that those TODOs are addressed as part of your project.

@seanlip seanlip added enhancement End user-perceivable enhancements. and removed issue_user_learner labels Mar 29, 2023
@adhiamboperes adhiamboperes added Work: Medium The means to find the solution is clear, but it isn't at good-first-issue level yet. work label added labels May 3, 2023
BenHenning added a commit that referenced this issue Jun 1, 2023
## Explanation

Fixes part of #52
Fixes #4606

 Feature implementation for #4606
- This PR introduces the ability to change App level language through
the Options setting. It has involved below changes.
1. Refactored the codebase to accomodate feature changes by changing
from use of string variable to OppiaLanguage
            proto enum object.
2. Add Changes to allow display of languages loaded from proto in a
human readable form similar to AudioLanguage
           representation. 
- When fully functional this PR should allow users to modify app
language in App settings regardless of the language setting of their
device. PersistentCache is used to locally persist language which has
been selected by a user.

See also KevinGitonga#5 for an
additional explanation of more specific changes contained within this
PR.

## Essential Checklist
<!-- Please tick the relevant boxes by putting an "x" in them. -->
- [x] The PR title and explanation each start with "Fix #bugnum: " (If
this PR fixes part of an issue, prefix the title with "Fix part of
#bugnum: ...".)
- [x] Any changes to
[scripts/assets](https://github.com/oppia/oppia-android/tree/develop/scripts/assets)
files have their rationale included in the PR explanation.
- [x] The PR follows the [style
guide](https://github.com/oppia/oppia-android/wiki/Coding-style-guide).
- [x] The PR does not contain any unnecessary code changes from Android
Studio
([reference](https://github.com/oppia/oppia-android/wiki/Guidance-on-submitting-a-PR#undo-unnecessary-changes)).
- [x] The PR is made from a branch that's **not** called "develop" and
is up-to-date with "develop".
- [x] The PR is **assigned** to the appropriate reviewers
([reference](https://github.com/oppia/oppia-android/wiki/Guidance-on-submitting-a-PR#clarification-regarding-assignees-and-reviewers-section)).

## For UI-specific PRs only
<!-- Delete these section if this PR does not include UI-related
changes. -->
If your PR includes UI-related changes, then:
- Add screenshots for portrait/landscape for both a tablet & phone of
the before & after UI changes
- For the screenshots above, include both English and pseudo-localized
(RTL) screenshots (see [RTL
guide](https://github.com/oppia/oppia-android/wiki/RTL-Guidelines))
- Add a video showing the full UX flow with a screen reader enabled (see
[accessibility
guide](https://github.com/oppia/oppia-android/wiki/Accessibility-(A11y)-Guide))
- Add a screenshot demonstrating that you ran affected Espresso tests
locally & that they're passing

## Video demo of changes

https://user-images.githubusercontent.com/20886444/222683790-7b2d4fa8-7068-4774-8d1a-0494d4f9adf0.mp4

---------

Co-authored-by: Ben Henning <[email protected]>
@BenHenning
Copy link
Member Author

Now that #4762 is merged, this should be fixed.

@github-actions
Copy link

github-actions bot commented Jun 3, 2023

The issue is reopened because of the following unresolved TODOs:

// TODO(#52): Enable this feature by default once it's completed.

BenHenning added a commit that referenced this issue Jun 6, 2023
## Explanation
Fixes #52

This PR finishes up a bunch of separate tasks relating to the 0.11
release of the Oppia Android app.

### Release plans
Note that a lot of the tasks addressed were completed out-of-band (hence
the lack of tracking issues). These are needed to prepare for the
following release changes:
- A new version of the alpha app will be launched to provide a basis of
testing spotlights
- A new version of the Kenya alpha app will be launched (since those
users are still in transitionary state to the beta version of the app
until later this year)
- A new version of the beta version of the app to include dark mode, the
new language selector, and more

### Overview

#### Language support changes
- Arabic and Nigerian Pidgin (Naija) languages were added to production
builds (Naija was added generally as it wasn't supported previously).
Both languages were also added as possible audio languages.
- Some basic tests were added to cover Arabic and Naija now being
available, though some tests ended up being omitted due to the inherent
complexity of testing these particular languages in certain cases
(Arabic because it's RTL and Naija because Android doesn't actually
support it natively--see below explanation).
- Also added Nigeria as a language region. We don't yet have a strong
grasp on the regions in which Arabic will be used, so that's being kept
as a broad language for now. We may refine this in the future.
- The translations for Nigerian Pidgin are added here as a replacement
to #5009 since the original translations had some formatting issues that
were identified by @adhiamboperes and subsequently fixed by our
translation volunteers. Since we can't wait for another push to #5009,
this PR is just introducing the strings directly.
- ``AndroidLocaleFactory`` was largely rebuilt to make better use of
code sharing, but its actual functionality needed to change due to the
Naija support problems mentioned below.

#### New feature: spotlights (alpha-only)
- A new alpha module was added to allow the team to stage features
specific to alpha builds, and spotlights were added as an initial use
case for this new capability.
- As part of testing spotlights I noticed that the background overlay
was too dark (it was fully occluding the background), so I changed it to
something that's dark but still semi-translucent. See the UI part of the
description below for a before-and-after.

#### New feature: in-app language selector (all users)
- This PR enables the new language selector introduced by #4762 by
default as part of addressing #52.
- Some small fast-follow nits from #4762 were addressed (see
#4762 (comment)
and
#4762 (comment)).

#### Event system changes
- Introduced a new script for decoding the compressed base 64 event
strings that can be generated during user studies (see explanation below
for details). This has some basic fault tolerance built into it so that
truncated event strings can still be partially decoded.
- A debug event property was added which essentially amounts to an event
count since app startup that's attached to each event. While this won't
help us identify events outright missing, it will help us identify
events missing between received events. This is aimed to help an ongoing
investigation that has found the high probability that events are being
lost between user action and Firebase's storage layer.

#### Infrastructure changes
- The minor version of the app is being bumped (since this is a major
beta release of the app).
- Version codes were bumped for 2 releases (since one re-release of the
beta version of the app was needed a few weeks back due to it expiring).
- This PR also quiets the output when creating AABs since currently ~5k
lines are outputted during the final bundle assembly steps and this
output is never useful to the user unless there's a build pipeline
failure.
- This PR fixes an error in the resource filtering output that is
provided at the very end of the AAB creation process (previously it was
outputting the number of configurations being filtered not the number of
actual resources being removed).

#### Improved support for future user studies
- The EnableLearnerStudyAnalytics has been split into 3 flags (2 new
ones): one that controls just whether to attach the sensitive profile
IDs to events, one that controls the fast in-lesson language switcher
(and corresponding admin-controlled profile setting for it), and one
that controls access to the analytics screen + admins being able to mark
lessons as completed for profiles (this is gated on the existing flag).
- The analytics screen flag has been default enabled for regular alpha
builds of the app so that this channel can be better utilized for user
studies. The user ID and in-lesson language switcher aspects of the old
learner study analytics feature are being kept off in alpha builds, only
the analytics screen & related behavior is being made available.

### Nigerian Pidgin support issues

The Android system does not formally support Nigerian Pidgin (Naija)
despite the fact that it has a recognized ISO 639-3 language code.

Naija is a creole language which means it's mostly a derivative of
English with vernacular adaptations (such as recreated words and grammar
alterations). I think that because it's mostly a derivative language and
is mainly used for casual speaking (vs. formal communications), there
isn't as much of a desire on the Android side to formally support it as
a UI language.

Fortunately, the Oppia Android app's localization system already
supports forcing the system to rendering app strings that are not
natively supported. However, this results in several considerations and
has turned up one new issue that needed addressing:
- Custom language overriding only works by matching _both_ language and
region, so the language strings needed to be moved to ``values-pcm-rNG``
(for Nigeria locking). This doesn't stop the language from being used
outside Nigeria, it's just a limitation in Android's resource qualifier
system when working with custom languages.
- It's not yet clear how the change in the values structure will affect
Translatewiki--some additional work might be needed there (which will
become clear once this PR is merged & Translatewiki attempts another
branch sync).
- Custom languages don't have the benefit of guaranteeing rendering
support, so the language's script largely comes to mind. Fortunately, as
a derivative of English Naija uses Latin-based script so there are no
concerns with language rendering compatibility.
- An issue was found in the localization system when handling fallbacks.
Since Naija is English-based, this PR has configured its fallback
language to be English. This led to the system actually prioritizing
English app string translations rather than forcing the Naija strings.
This required the changes that can be seen in ``AndroidLocaleFactory``.

### ``DecodeUserStudyEventString`` utility

A new utility was introduced to decode the compressed Base64 string of
events logs that can be exported from devices being used for user
studies (i.e. whose admins have access to the learner analytics screen).
These logs represent the entirety of both pending and uploaded logs
since the introduction of the feature (but only for devices that have
the learner study enabled).

The utility reads an input file containing a single instance of the
string (and automatically strips newline and horizontal space formatting
since the output from the app includes line-wrapping) and outputs it to
one of three indicated formats: textproto, JSON, or Yaml.

The script can be run in a local terminal from this branch (or
``develop`` once it's checked in) at the repository root by running:

```sh
bazel run //scripts:decode_user_study_event_string -- $(pwd)/input.log $(pwd)/output.json
```

(where 'input.log' exists in the local repository root, and
'output.json' will be written to the local repository root).

For use outside of Bazel, one can use a pre-built deployment Jar file by
running:

```sh
java -jar decode_user_study_event_string_deploy.jar input.log output.json
```

(Note that the error output for this command will be assuming Bazel is
being used, so some adjustment may be needed to interpret CLI errors
when using the deploy Jar).

### Third-party dependency updates
Some new dependencies were needed for the new
``DecodeUserStudyEventString`` utility to make the implementation much
simpler:
- Protobuf's Java util
(https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.util)
for conversion from proto to json.
- A converter from JSON to Yaml (since there's no direct proto-to-yaml
conversion): https://github.com/xlate/yaml-json.
- The Jakarta JSON API (required by the converter):
https://jakarta.ee/specifications/platform/9/apidocs/jakarta/json/json.
- The Jakarta JSON Parsson implementation (runtime dependency required
by the converter): https://github.com/eclipse-ee4j/parsson.
- Snakeyaml implementation (runtime dependency required by the
converter): https://github.com/snakeyaml/snakeyaml.

This required an update to maven_install.json, but no changes are needed
in tracked Maven dependency licenses since these are not dependencies
that are deployed with the app to end users.

The above do result in an incidental update to Gson 2.8.6 (from the
current 2.8.5 used). I don't expect that this actually will affect the
release much since Gson isn't used broadly, and this is a minor update
to Gson.

### Exemptions & test notes
Two new files were exempted for tests:
- ``PlatformParameterAlphaModule``: while we can test modules, I'm not
actually keen on testing the platform parameter modules at this time
because staging is generally messy at the moment with a lot of
duplication across multiple modules, so the test complexity isn't small.
A lot of the platform parameter system needs to be streamlined, but
that's largely dependent on #1720 being finished.
- ``DecodeUserStudyEventString`` while not particularly difficult to
test, this is a special local analytics tool that will rarely be used
and is very unlikely to break. Since I'm strapped for time on this PR,
I'm forgoing adding tests for this utility.

Regarding broad testing coverage, everything has had corresponding
testing additions or changes where applicable. This PR might not have
quite as much testing thoroughness as other PRs, but it does largely
cover the core scenarios.

## Essential Checklist
- [x] The PR title and explanation each start with "Fix #bugnum: " (If
this PR fixes part of an issue, prefix the title with "Fix part of
#bugnum: ...".)
- [x] Any changes to
[scripts/assets](https://github.com/oppia/oppia-android/tree/develop/scripts/assets)
files have their rationale included in the PR explanation.
- [x] The PR follows the [style
guide](https://github.com/oppia/oppia-android/wiki/Coding-style-guide).
- [x] The PR does not contain any unnecessary code changes from Android
Studio
([reference](https://github.com/oppia/oppia-android/wiki/Guidance-on-submitting-a-PR#undo-unnecessary-changes)).
- [x] The PR is made from a branch that's **not** called "develop" and
is up-to-date with "develop".
- [x] The PR is **assigned** to the appropriate reviewers
([reference](https://github.com/oppia/oppia-android/wiki/Guidance-on-submitting-a-PR#clarification-regarding-assignees-and-reviewers-section)).

## For UI-specific PRs only

Spotlights changes before/after:
| Old spotlights background | New spotlights background |
|--------|--------|
|
https://github.com/oppia/oppia-android/assets/12983742/a8df7807-1bb6-45be-b53a-6d057f4a5931
|
https://github.com/oppia/oppia-android/assets/12983742/e499f4b6-4609-4e58-871f-a09ebd09a80d
|

Video demonstrating the new functionality in the app, including alpha
access to the learner analytics screen and support for both Nigerian
Pidgin and Arabic (and via the in-app language selector):


https://github.com/oppia/oppia-android/assets/12983742/c0a92393-a8a3-4634-af5b-2e7fc35ecd97

---------

Co-authored-by: translatewiki.net <[email protected]>
@KolliAnitha
Copy link

App language screen is now seen and it is unique to each profile
subject (9)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement End user-perceivable enhancements. Impact: Medium Moderate perceived user impact (non-blocking bugs and general improvements). Issue: Needs Break-down Indicates that an issue is too large and should be broken into smaller chunks. Issue: Needs Clarification Indicates that an issue needs more detail in order to be able to be acted upon. Priority: Nice-to-have This work item is nice to have for its milestone. Work: Medium The means to find the solution is clear, but it isn't at good-first-issue level yet. Z-ibt Temporary label for Ben to keep track of issues he's triaged.
Development

Successfully merging a pull request may close this issue.

6 participants