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

Add the menu option to set Translation source #149

Open
2 tasks done
angrezichatterbox opened this issue Sep 23, 2024 · 13 comments
Open
2 tasks done

Add the menu option to set Translation source #149

angrezichatterbox opened this issue Sep 23, 2024 · 13 comments
Assignees
Labels
feature New feature or request good first issue Good for newcomers hacktoberfest Included as a part of Hacktoberfest help wanted Extra attention is needed

Comments

@angrezichatterbox
Copy link
Member

Terms

Description

Currently the individual language settings doesn't allow the user to set the translation source for each language keyboard settings. The issue aims to add the ability to set translation source language for each language keyboard separately. This could be stored in the shared preferences for now for each language separately similar to how it is being done for period_on_double_tap.

A visual reference of how this option would look is given below.

Screenshot 2024-09-24 at 12 39 00 AM

Contribution

I would love to work on this and am more than happy to help anyone fix this issue :)

@angrezichatterbox angrezichatterbox added feature New feature or request good first issue Good for newcomers help wanted Extra attention is needed labels Sep 23, 2024
@angrezichatterbox angrezichatterbox changed the title Set Translation source language for each keyboard settings page Set Translation source language for each language keyboard settings Sep 23, 2024
@andrewtavis andrewtavis added the hacktoberfest Included as a part of Hacktoberfest label Sep 30, 2024
@henrikth93 henrikth93 self-assigned this Oct 10, 2024
@henrikth93 henrikth93 assigned henrikth93 and unassigned henrikth93 Dec 11, 2024
@ThousandYearGrind
Copy link

ThousandYearGrind commented Dec 11, 2024

@henrikth93, Hi, does this work?

@henrikth93
Copy link
Member

@henrikth93, Hi, does this work?

Should work now!

@angrezichatterbox angrezichatterbox changed the title Set Translation source language for each language keyboard settings Add the menu option to set Translation source Dec 14, 2024
@andrewtavis
Copy link
Member

Hey @ThousandYearGrind 👋 Quick note that this issue is now just to add the menu option that selects from a list, so at the end of it we want the menu option that's shown in the issue text and the interface like this in the Figma designs. Actually switching the translation language will be handled by #265 once this issue is finished - i.e. this issue is for the interface and #265 is for the functionality.

@ThousandYearGrind
Copy link

Ahhh, thank you. I was scratching my head over that for a while.

@ThousandYearGrind
Copy link

ThousandYearGrind commented Dec 19, 2024

@andrewtavis How should I approach translations? Can I just run "Translation source language" through google translate or should this be done later by someone else?

@andrewtavis
Copy link
Member

We'll have local translations for this, @ThousandYearGrind :) This issue is just for the menu option to select the base language.

@ThousandYearGrind
Copy link

ThousandYearGrind commented Dec 20, 2024

Hi @andrewtavis, where would be a good place to ask code-specific questions? I've been trying to figure out how to do something for a while.

@andrewtavis
Copy link
Member

@ThousandYearGrind, asking them here would be good, that way it's easy for us to link to files :)

@ThousandYearGrind
Copy link

ThousandYearGrind commented Dec 21, 2024

@andrewtavis So I've added the option for the settings screen using a ClickableItem like the app language setting. Now, I need to set the action that takes place when the user clicks on the setting.

val appSettingsItemList =
        listOf(
            ScribeItem.ClickableItem(
                title = stringResource(R.string.app_settings_menu_app_language),
                desc = stringResource(R.string.app_settings_menu_app_language_description),
                action = onLanguageSelect,
            ),
            ScribeItem.SwitchItem(
                title = stringResource(R.string.app_settings_menu_app_color_mode),
                desc = stringResource(R.string.app_settings_menu_app_color_mode_description),
                state = isUserDarkMode,
                onToggle = { isUserDarkMode1 ->
                    onDarkModeChange(isUserDarkMode1)
                },
            ),
            ScribeItem.SwitchItem(
                title = stringResource(R.string.app_settings_keyboard_keypress_vibration),
                desc = stringResource(R.string.app_settings_keyboard_keypress_vibration_description),
                state = vibrateOnKeypress.value,
                onToggle = { shouldVibrateOnKeypress ->
                    vibrateOnKeypress.value = shouldVibrateOnKeypress
                    PreferencesHelper.setVibrateOnKeypress(context, shouldVibrateOnKeypress)
                },
            ),
            ScribeItem.SwitchItem(
                title = stringResource(R.string.app_settings_keyboard_functionality_popup_on_keypress),
                desc = stringResource(R.string.app_settings_keyboard_functionality_popup_on_keypress_description),
                state = popupOnKeypress.value,
                onToggle = { shouldPopUpOnKeypress ->
                    popupOnKeypress.value = shouldPopUpOnKeypress
                    PreferencesHelper.setShowPopupOnKeypress(context, shouldPopUpOnKeypress)
                },
            ),
            ScribeItem.ClickableItem(
                title = stringResource(R.string.app_settings_menu_translation_language),
                desc = stringResource(R.string.app_settings_menu_translation_language_description),
                action = onTranslationLanguageSelect,
            ),
        )
Screenshot 2024-12-21 at 4 40 15 PM

I looked at the app language setting's action and it uses an intent, but I'm not sure how to do this for the translation language setting.

    private fun selectTranslationLanguage() {
        
    }

    private fun selectLanguage() {
        val packageName = requireActivity().packageName
        val intent =
            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
                Intent(ACTION_APP_LOCALE_SETTINGS)
            } else {
                Intent(ACTION_APPLICATION_DETAILS_SETTINGS).apply {
                    data = Uri.fromParts("package", packageName, null)
                    putExtra(
                        "android.intent.extra.SHOW_FRAGMENT",
                        "com.android.settings.localepicker.LocaleListEditor",
                    )
                }
            }
        intent.data = Uri.fromParts("package", packageName, null)
        startActivity(intent)
    }

@andrewtavis
Copy link
Member

Hey @ThousandYearGrind 👋 Firstly, could we get this menu option moved into the settings for each language keyboard, so it wouldn't be on settings, but on your screen it would be in French and English. We made the decision to have it there as there are members of the community who would translate from different languages: say French to Spanish and English to German.

From there we won't be having it function like the app's language selection. Clicking that option will take the user to a sub menu with radio options. Maybe you can make the change for the menu option location and then open a PR and we can then assist on making the radio option menu?

@ThousandYearGrind
Copy link

@andrewtavis I've done as you suggested and moved the menu option to the language keyboard. Should I submit a PR now?
Screenshot 2024-12-27 at 3 41 29 PM

@andrewtavis
Copy link
Member

We're basically there, @ThousandYearGrind! Could you refer to where it should be located in the designs for this tab? Pasting an image of its location in its own sub menu below as well:

Keyboard Settings - Light

Feel free to open a PR once it's been moved!

@andrewtavis
Copy link
Member

And thanks for your persistence here!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request good first issue Good for newcomers hacktoberfest Included as a part of Hacktoberfest help wanted Extra attention is needed
Projects
Status: Todo
Development

No branches or pull requests

4 participants