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

feat: Allow to include translations for extended profile fields #10

Conversation

johanseto
Copy link
Collaborator

@johanseto johanseto commented Jan 23, 2024

Description

Pr migration.
(cherry picked from commit 5d03359)

Testing instructions

Install eox-nelp and some other packages need it like.

pip install edx-event-routing-backends
pip install git+https://github.com/eduNEXT/eox-nelp.git

Add the middleware of eox-nelp.

MIDDLEWARE += [
    "eox_nelp.middleware.ExtendedProfileFieldsMiddleware",
]

Abd in tenant config the following.

    "REGISTRATION_EXTRA_FIELDS": {
        "city": "hidden",
        "confirm_email": "hidden",
        "country": "optional",
        "first_name": "required",
        "gender": "optional",
        "goals": "optional",
        "hobby": "optional",
        "honor_code": "required",
        "last_name": "required",
        "level_of_education": "optional",
        "mailing_address": "hidden",
        "movie": "optional",
        "sport": "optional",
        "terms_of_service": "hidden",
        "year_of_birth": "optional"
    },
    "extended_profile_fields": [
        "hobby",
        "sport",
        "movie"
    ],
    "extended_profile_fields_translations": {
        "ar": {
            "hobby": "\u0647\u0648\u0627\u064a\u0629",
            "movie": "\u0641\u064a\u0644\u0645",
            "sport": "\u0631\u064a\u0627\u0636\u0629"
        }
    }

Check translation works in account settings view changing the language.

Before

2024-01-23_16-53

After

2024-01-23_16-59

Extra information

This need eox-nelp, to use the middleware of extended profile fields. For account settings view, the middleware is working but the register modal is not showing the custom fields using the extended_profile_fields.

Screenshot from 2024-01-23 17-01-36

Co-authored-by: Andrey Cañon <[email protected]>
@johanseto johanseto force-pushed the jlc/palm-mig/extended-profile-fields-translations branch from b4e4dfd to 4d24257 Compare January 26, 2024 16:17
@johanseto
Copy link
Collaborator Author

Tested after test fix and still working.
image

Copy link
Collaborator

@andrey-canon andrey-canon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The middleware is not required since this is specific for account settings, anyway worked as expected

image

@johanseto johanseto merged commit 55cc8e6 into open-release/palm.nelp Jan 31, 2024
40 checks passed
@johanseto
Copy link
Collaborator Author

Working in palm alpha.
Peek 2024-02-22 18-41

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants