[Feature] Improve legal code language selection/fallback #448
Labels
💻 aspect: code
Concerns the software code in the repository
🕹 aspect: interface
Concerns end-users' experience with the software
✨ goal: improvement
Improvement to an existing feature
help wanted
Open to participation from the community
🟩 priority: low
Low priority and doesn't need to be rushed
🏁 status: ready for work
Ready for work
Problem
The language selection/fallback for Deeds & UX is robust:
cc-legal-tools-app/i18n/utils.py
Lines 256 to 263 in 1906900
However, logic for the legal code translation domains use a naive version:
cc-legal-tools-app/i18n/utils.py
Lines 266 to 269 in 1906900
Description
load_legal_code_translations()
) that populate a new variable (ex.settings.LANGUAGES_AVAILABLE_LEGAL_CODE
)load_deeds_ux_translations()
function)get_default_language_for_jurisdiction_naive()
->get_default_language_for_jurisdiction_legal_code()
get_default_language_for_jurisdiction_naive()
function should be replaced with aget_default_language_for_jurisdiction_legal_code()
functionsettings.LANGUAGES_AVAILABLE_LEGAL_CODE
)get_default_language_for_jurisdiction_deed()
function relies onsettings.LANGUAGES_MOSTLY_TRANSLATED
)get_default_language_for_jurisdiction_deed()
->get_default_language_for_jurisdiction_deed_ux()
get_default_language_for_jurisdiction_deed()
function should be renamed toget_default_language_for_jurisdiction_deed_ux()
settings.LANGUAGES_MOSTLY_TRANSLATED
->settings.LANGUAGES_AVAILABLE_DEEDS_UX
settings.LANGUAGES_MOSTLY_TRANSLATED
variable should be rename tosettings.LANGUAGES_AVAILABLE_DEEDS_UX
Additional context
get_default_language_for_jurisdiction_naive()
function)Implementation
The text was updated successfully, but these errors were encountered: