Skip to content

Commit

Permalink
feat: Allow to include translations for extended profile fields
Browse files Browse the repository at this point in the history
(cherry picked from commit 5d03359)
  • Loading branch information
andrey-canon authored and johanseto committed Jan 23, 2024
1 parent e1c9e89 commit 5ad0e35
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions openedx/core/djangoapps/user_api/accounts/settings_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
from openedx.core.djangoapps.lang_pref.api import all_languages, released_languages
from openedx.core.djangoapps.programs.models import ProgramsApiConfig
from openedx.core.djangoapps.site_configuration import helpers as configuration_helpers
from openedx.core.djangoapps.theming import helpers as theming_helpers
from openedx.core.djangoapps.user_api.accounts.toggles import (
should_redirect_to_account_microfrontend,
should_redirect_to_order_history_microfrontend
Expand Down Expand Up @@ -270,6 +271,13 @@ def _get_extended_profile_fields():
"profession": _("Profession"),
"specialty": _("Specialty")
}
request = theming_helpers.get_current_request()
extended_profile_fields_translations = configuration_helpers.get_value(
'extended_profile_fields_translations',
{},
)
translations = extended_profile_fields_translations.get(request.LANGUAGE_CODE, {})
field_labels_map.update(translations)

extended_profile_field_names = configuration_helpers.get_value('extended_profile_fields', [])
for field_to_exclude in fields_already_showing:
Expand Down

0 comments on commit 5ad0e35

Please sign in to comment.