-
-
Notifications
You must be signed in to change notification settings - Fork 94
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
[Feature] Improve legal code language selection/fallback #483
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please run the static analysis tools and resolve any issues identified (./dev/tools.sh
).
There are also a few test failures (run tests with ./dev/coverage.sh
)
@manulthanura thank you for this work! There's a few items to resolve before I can properly verify it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the updates.
@manulthanura Please also fix the checklist formatting in the pull request (PR) description |
Fixes
Description
This pull request addresses the improvement of the legal code language selection and fallback logic in the
cc-legal-tools-app
. The current fallback mechanism for legal code translations uses a naive method, which has been updated to a more robust approach similar to the Deeds & UX translation logic.The changes include:
load_legal_code_translations()
to populate available legal code translations.get_default_language_for_jurisdiction_naive()
function withget_default_language_for_jurisdiction_legal_code()
for a more sophisticated fallback logic based on the newly addedsettings.LANGUAGES_AVAILABLE_LEGAL_CODE
.get_default_language_for_jurisdiction_deed()
toget_default_language_for_jurisdiction_deed_ux()
to clarify its scope.Technical details
load_legal_code_translations()
function populatessettings.LANGUAGES_AVAILABLE_LEGAL_CODE
with the available languages for each jurisdiction.settings.LANGUAGES_AVAILABLE_LEGAL_CODE
. If not, it falls back to the default language specified in thesettings.LANGUAGE_CODE
.Tests
To verify:
settings.LANGUAGES_AVAILABLE_LEGAL_CODE
.Checklist
Update index.md
).main
ormaster
).visible errors.
Developer Certificate of Origin
For the purposes of this DCO, "license" is equivalent to "license or public domain dedication," and "open source license" is equivalent to "open content license or public domain dedication."
Developer Certificate of Origin