tutorial working across languages - #618
Conversation
Thank you for the pull request! 💙🩵The Scribe-Android team will do our best to address your contribution as soon as we can. The following are some important points:
Note Scribe uses Conventional Comments in reviews to make sure that communication is as clear as possible. |
Maintainer ChecklistThe following is a checklist for maintainers to make sure this process goes as well as possible. Feel free to address the points below yourself in further commits if you realize that actions are needed :)
|
|
Hey @ashb155! A couple of comments on this from playing around with it :)
|
|
Would you also want to look into opening a PR in Scribe-i18n with the strings that are needed for the tutorial? CC @prince-0408 and @angrezichatterbox for discussions about Scribe-i18n for Scribe-Android - let's continue to make sure that we have all the strings in that are needed for the apps in Scribe-i18n 👋 |
|
hi @andrewtavis, thanks for your review and detailed comments, will have a look and work on them also with regards to the PR for Scribe-i18n, sounds good, how about I hardcode the required strings as of now (as done in the PR), and later on once finalized we could maybe have a PR for i18n |
|
Hard coding now and then migrating them to Scribe-i18n and then updating Scribe-i18n within the Android app is the exact thing we'd do, @ashb155 😊 Thanks so much! Looking forward to further commits! |
|
Note @ashb155: We've been updating the Scribe-i18n project with many strings that are needed for the project. We did a few of the strings for the tutorial, which are now on main. Would be great if these could be brought into this PR as well. Also let us know what the other strings that are needed for the tutorial are. You could also do a PR to Scribe-i18n with them. You can see the related strings here: Let us know if you need any support here! |
|
Note that the plan is that we'll finalize scribe-org/Scribe-i18n#116 and then bring in the updated Scribe-i18n into this PR :) |
|
Feel free to bring in the new version of Scribe-i18n as described in the shell scripts of the repo root/contributing guide, @ashb155 :) So great that this is making such good progress 😊 |
|
note @angrezichatterbox: This should be ready for review as soon as the Scribe-i18n and related refactor come in :) |
|
Let us know when this is ready for a final review, @ashb155! |
|
fixed the merge conflicts @andrewtavis , do let me know if it's good to go! |
|
Taking a look over this now : ) |
angrezichatterbox
left a comment
There was a problem hiding this comment.
Thanks for the wonderful work @ashb155 Have a few things that I wanted to be checked from your end. I will be happy to get those done if you are occupied with work. Thanks again for the awesome work.
| val (fatherWord, fatherTag, fatherGender) = | ||
| when (languageCode) { | ||
| "en" -> Triple("father", "M", "Masculine") | ||
| "es" -> Triple("padre", "M", "Masculino") | ||
| "fr" -> Triple("père", "M", "Masculin") | ||
| "it" -> Triple("padre", "M", "Maschile") | ||
| "pt" -> Triple("pai", "M", "Masculino") | ||
| "ru" -> Triple("отец", "M", "Мужской") | ||
| "sv" -> Triple("far", "C", "Common") | ||
| else -> Triple("Vater", "M", "Maskulin") | ||
| } | ||
|
|
||
| val (motherWord, motherTag, motherGender) = | ||
| when (languageCode) { | ||
| "en" -> Triple("mother", "F", "Feminine") | ||
| "es" -> Triple("madre", "F", "Femenino") | ||
| "fr" -> Triple("mère", "F", "Féminin") | ||
| "it" -> Triple("madre", "F", "Femminile") | ||
| "pt" -> Triple("mãe", "F", "Feminino") | ||
| "ru" -> Triple("мать", "F", "Женский") | ||
| "sv" -> Triple("mor", "C", "Common") | ||
| else -> Triple("Mutter", "F", "Feminin") | ||
| } | ||
|
|
There was a problem hiding this comment.
Could you correct the chracter we use to indicate the feminine neutral and masucline in case of certain languages like russian within the copy thats shown to user in noun suggestion.
| fun getNounAnnotationSteps( | ||
| languageCode: String, | ||
| context: Context, | ||
| ): List<TutorialStep> { | ||
| val (fatherWord, fatherTag, fatherGender) = |
There was a problem hiding this comment.
For some languages could u verify wheather the nouns have gender in the db. If not we could have them checked on why the aren't present.
There was a problem hiding this comment.
I wasn't able to get mother in english for example
There was a problem hiding this comment.
Mother in English shouldn't have a gender. If the user just has English installed, then we should maybe disable that tutorial option. If the user has say German and English, then we should have an option for no noun annotations for English. We should similarly have this for languages where verb conjugation isn't a thing 😊
| */ | ||
| val wordTranslationSteps = | ||
| listOf( | ||
| fun wordTranslationSteps( | ||
| languageCode: String, | ||
| context: Context, | ||
| ): List<TutorialStep> { | ||
| val translation = | ||
| when (languageCode) { | ||
| "en" -> "Translate" | ||
| "es" -> "Traducir" | ||
| "fr" -> "Traduire" | ||
| "it" -> "Tradurre" | ||
| "pt" -> "Traduzir" | ||
| "ru" -> "Перевести" | ||
| "sv" -> "Översätt" | ||
| else -> "Übersetzen" | ||
| } | ||
| return listOf( | ||
| TutorialStep( | ||
| instruction = | ||
| "Let's translate! Tap the \u27A1 Scribe key on the top-left " + | ||
| "corner of your keyboard, and select \u00DCbersetzen.\n\n" + | ||
| "Then write the word you want to translate, press \u25B6, " + | ||
| "and the translation will be returned to you.", | ||
| hint = "If your second language is not German, change the language in your keyboard.", | ||
| context | ||
| .getString(R.string.i18n_app_keyboard_tutorial_word_translation_instruction) | ||
| .replace("{translate}", translation), |
There was a problem hiding this comment.
Could you do the same as above for this and check as well
|
I'll add some strings into Scribe-i18n for noun annotation and verb conjugation not being an option for the language :) |
|
@ashb155, you can bring in the new version of Scribe-i18n and that will give you the |
Contributor checklist
./gradlew lintKotlin detekt testcommand as directed in the testing section of the contributing guideDescription
This PR updates the quick tutorial to dynamically adapt its prompts, hints, and expected inputs based on the user's active Scribe keyboard language, resolving the issue of users being forced to use the German layout.
Key Changes:
TutorialContent.ktto supply localized words ("Mother"/"Father", gender tags) and hints for all 8 supported languages.BroadcastReceiverinTutorialNavigator.ktto instantly update the tutorial text if the user switches keyboards mid-tutorial.Related issue
Closes #616