-
Notifications
You must be signed in to change notification settings - Fork 534
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
Fix #4002: Profiles cant have internationalised names #4081
Fix #4002: Profiles cant have internationalised names #4081
Conversation
Note that this regex pattern will allow mixing of English and non English characters as some languages use of combination of those, for ex, Spanish, German, etc. Kindly let me know if any further changes are required in the logic part @srushtirk |
PTAL @BenHenning @bkaur-bkj Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @JishnuGoyal! Left some initial comments--PTAL.
domain/src/main/java/org/oppia/android/domain/profile/ProfileManagementController.kt
Outdated
Show resolved
Hide resolved
domain/src/main/java/org/oppia/android/domain/profile/ProfileManagementController.kt
Outdated
Show resolved
Hide resolved
domain/src/main/java/org/oppia/android/domain/profile/ProfileManagementController.kt
Outdated
Show resolved
Hide resolved
Unassigning @BenHenning since the review is done. |
Hi @JishnuGoyal, it looks like some changes were requested on this pull request by @BenHenning. PTAL. Thanks! |
Hello, @srushtirk , could you give some test cases/ examples of what names are acceptable and which ones are not acceptable? This is one of the constraints I found, but I want to know if there are any more of such constraints that are needed to be taken care of. |
Unassigning @JishnuGoyal since a re-review was requested. @JishnuGoyal, please make sure you have addressed all review comments. Thanks! |
Hi @JishnuGoyal let's allow any order for the symbols . , ', -, English and non English characters. As it is difficult to predict where exactly in the user's name would these symbols be. This causes some edge cases where users can create profiles with random names starting or ending with these symbols, which is fine to trade off with. We can put the following restrictions though:
|
PTAL @BenHenning , Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @JishnuGoyal! Added some more comments for ways I think this could be simplified, and made more future-proof.
domain/src/main/java/org/oppia/android/domain/profile/ProfileManagementController.kt
Outdated
Show resolved
Hide resolved
domain/src/main/java/org/oppia/android/domain/profile/ProfileManagementController.kt
Outdated
Show resolved
Hide resolved
domain/src/main/java/org/oppia/android/domain/profile/ProfileManagementController.kt
Outdated
Show resolved
Hide resolved
domain/src/main/java/org/oppia/android/domain/profile/ProfileManagementController.kt
Outdated
Show resolved
Hide resolved
domain/src/main/java/org/oppia/android/domain/profile/ProfileManagementController.kt
Outdated
Show resolved
Hide resolved
Hi @JishnuGoyal, I'm going to mark this PR as stale because it hasn't had any updates for 7 days. If no further activity occurs within 7 days, it will be automatically closed so that others can take up the issue. |
I'm now taking a look at this (since it's functionality that we'd like to include in the upcoming beta release). |
…alised-names Profiles cant have internationalised names
…ame-support Conflicts: domain/src/main/java/org/oppia/android/domain/profile/ProfileManagementController.kt scripts/assets/file_content_validation_checks.textproto
Created JishnuGoyal#1 to address the conflicts & broken tests. PTAL @JishnuGoyal. |
…-profile-name-support Suggested fixes for PR oppia#4081
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Latest changes look good and CI is now passing. There are two comments that still need resolution before this can be fixed, though I think I'm going to go ahead and merge this and then address them in a separate PR (to avoid needing another day of iteration).
domain/src/test/java/org/oppia/android/domain/profile/ProfileManagementControllerTest.kt
Outdated
Show resolved
Hide resolved
utility/src/test/java/org/oppia/android/util/profile/BUILD.bazel
Outdated
Show resolved
Hide resolved
utility/src/test/java/org/oppia/android/util/profile/ProfileNameValidatorTest.kt
Show resolved
Hide resolved
Assigning @rt4914, @vinitamurthi, @anandwana001 for code owner reviews. Thanks! |
…n the latest pt-BR translations (#4565) ## Explanation Fixes #4348 This PR performs the final preparation tasks necessary for the MR1 Beta release to be cut. Specifically: - It updates the version codes & minor version. - It pulls the latest pt-BR translations (for the ones that didn't make it in the automatic Thursday Translatewiki push). - It addresses the final open comments from #4081 which included me needing to do the pt-BR translation for 2 strings related to profile names (I used Google Translate then made minor modifications). There are no tests affected directly by these changes (though we could consider adding some in the future). ## 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 For the most part this PR is not UI-tied (though obviously the 1 English string change and all of the pt-BR string changes affect UIs). I'm deciding not to include screenshots for string-only changes since they aren't very interesting in this case (i.e. they don't seem like they would actually break the UI to warrant including screenshots). Commits: * Create dedicated alpha application component. This simplifies application component management significantly and allows individual build flavors to have their own unique module lists. * Add beta & GA update notices. This also introduces dedicated beta & GA build flavors which is a necessary prerequisite. It also introduces an extra beta, alpha, and dev mode labels for the splash screen (the latter 2 were extra) with 2 second minimum wait timers for beta and alpha to ensure they are seen. A 5-second safety timer was added to ensure the splash screen can always be passed even if something goes wrong at the domain level (since there are now quite a few moving pieces to determine the user's current onboarding state). * Add build tests for the new beta & GA flavors. * Fix broken test per earlier changes. * Fix general broken tests & builds. Tests broken due to changes to the app startup experience haven't yet been fixed. * Lint fixes. * First part of adding tests for GA notices. There's a bunch left to do here, this is mainly needed so that I can transfer changes to a different machine. * Update TransformAndroidManifestTest.kt Correct typos. * Fix tests & static checks. This also removes temporary debug code and TODOs, and finishes the tests for SplashActivity. * Post-merge fixes. * Test fixes. * Fix Gradle test. * Add some string resource checks/tools. Also, fixes major performance issue with all file-based CI checks. * Ensure newline consistency in translated strings. Also, fix reporting in new validation check script. * Add tests & fix static checks. * Update version codes & pt-BR strings. The strings were manually pulled Translatewiki. * Follow-up adjustments after self-review. * Add latest translated pt-BR strings. * Address comments from #4081.
Explanation
Fixes #4002
This PR introduces a new injectable class into the codebase called
ProfileNameValidator
.This class uses Kotlin functions to verify input, instead of Regex patterns which were used earlier.
In addition to what functionalities the regex patterns supported, this solution will now accept all International characters(English + non-English letters), and these characters:
.
,'
,-
It will also reject the following:
Numbers (0, 1, 2, ... 9)
Symbols (!@#$%^&*... etc.)
Parentheses and Brackets ( (, [, { )
These built-in Kotlin methods function do not interfere with the RTL markers.
Hindi and Arabic profiles successfully created:
Essential Checklist