-
Notifications
You must be signed in to change notification settings - Fork 27
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
Implement Multi-Language support #113
Conversation
Refactor + Clean up
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.
General question: Can the translations work with properties provided from another source other than loading them from the resources
directory? For the forms, you can build from a file in the assets or from a String
source which can be stored in any place hence the reasons for having 2 constructors for the form builder. One accepts name of file in the assets directory whereas the other uses the JSON string provided.
neat-form-core/src/main/java/com/nerdstone/neatformcore/form/json/JsonFormBuilder.kt
Outdated
Show resolved
Hide resolved
neat-form-core/src/main/java/com/nerdstone/neatformcore/internationalization/LanguageHelper.kt
Outdated
Show resolved
Hide resolved
neat-form-core/src/main/java/com/nerdstone/neatformcore/internationalization/LanguageHelper.kt
Outdated
Show resolved
Hide resolved
neat-form-core/src/main/java/com/nerdstone/neatformcore/internationalization/LanguageHelper.kt
Outdated
Show resolved
Hide resolved
The form was NOT translated when I changed device language to Kiswahili (both Tanzanian and Kenyan dialect). French translation works but appears the skip logic applied via the rules is affected. My thinking is it maybe referencing actual text instead of the keys for the options. That can be corrected. |
@dubdabasoduba Can you review this? I am gonna assign you to it as well. Thanks. |
-Clean up code
Codecov Report
@@ Coverage Diff @@
## master #113 +/- ##
============================================
- Coverage 75.01% 74.91% -0.11%
- Complexity 422 425 +3
============================================
Files 40 41 +1
Lines 1429 1443 +14
Branches 321 321
============================================
+ Hits 1072 1081 +9
- Misses 110 115 +5
Partials 247 247
Continue to review full report at Codecov.
|
We had configured the translation with the incorrect locale suffix. For Swahili should be |
Depends on how we'd want to implement this e.g.
|
I assume the translations will be provided alongside the form, that way we go with second option as it is more flexible. |
@ndegwamartin Can you update spinner widget and any other widget with options that is saving the label instead of the key for the option. This is affecting rules processing in a multilanguange setup. E.g if the rule is declared to use the default language label, it will not work for other languages. This is reproducible on the Spinner. Debug this method |
neat-form-core/src/main/java/com/nerdstone/neatformcore/internationalization/LanguageHelper.kt
Outdated
Show resolved
Hide resolved
Did you push the fix for Swahili translation? I see the file extension is still the same in your last commit. |
Also remember to increment the app version in the README/build.gradle file. I will remove Bintray configs in another commit, for now we can work with GitHub Package Registry. |
If we pick the second option I think we'd then need to modify the constructor to accept an optional language translation file (or content) |
Alright we can overload.
…On Mon, May 17, 2021, 8:43 PM Martin Ndegwa ***@***.***> wrote:
Depends on how we'd want to implement this e.g.
- Would we want to store that *json string* form as already translated?
- If not, are the translations also provided alongside it?
I assume the translations will be provided alongside the form, that way we
go with second option as it is more flexible.
If we pick the second option I think we'd then need to modify the
constructor to accept an optional language translation file (or content)
—
You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub
<#113 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AGM667AEUFN4GHXCPB4EW53TOFIVNANCNFSM43UQOBDQ>
.
|
Refactor and clean up
@ndegwamartin I experienced app crash in Android version 10 Error logs 2021-05-25 16:20:45.333 3412-3412/com.nerdstone.neatform W/ActivityThread: handleWindowVisibility: no activity for token android.os.BinderProxy@b5ec994
2021-05-25 16:20:45.417 3412-3412/com.nerdstone.neatform E/CustomExceptions$$special$$inlined$CoroutineExceptionHandler: CoroutineExceptionHandler got java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Class java.lang.Object.getClass()' on a null object reference |
neat-form-core/src/main/java/com/nerdstone/neatformcore/form/json/JsonFormBuilder.kt
Outdated
Show resolved
Hide resolved
I have opened the new issue for fixing the issue with the spinner skip logic. This is good to go 👍 |
Closes #69