Skip to content

feat(theme): expose available languages in logged_user endpoint#1121

Merged
Garfield-fr merged 1 commit into
rero:stagingfrom
Garfield-fr:zub-languages-improvement
Jul 22, 2026
Merged

feat(theme): expose available languages in logged_user endpoint#1121
Garfield-fr merged 1 commit into
rero:stagingfrom
Garfield-fr:zub-languages-improvement

Conversation

@Garfield-fr

Copy link
Copy Markdown
Contributor

No description provided.

@Garfield-fr Garfield-fr self-assigned this Jun 29, 2026
@coderabbitai

coderabbitai Bot commented Jun 29, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

The logged_user JSON endpoint in sonar/theme/views.py now includes an availableLanguages field in the settings payload. This list defaults to ["English"] and is extended with entries from current_app.config["I18N_LANGUAGES"]. The corresponding test in tests/ui/test_views.py is updated to assert both document_identifier_link and availableLanguages fields specifically, replacing the previous generic truthy check on settings.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive No meaningful pull request description was provided to assess against the changeset. Add a short description of the logged_user settings change and the related test update.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: exposing available languages in the logged_user endpoint.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@sonar/theme/views.py`:
- Around line 127-128: The fallback language label in the availableLanguages
list is hardcoded as English and should be translatable like the configured
I18N_LANGUAGES entries. Update the availableLanguages construction in
sonar/theme/views.py to wrap the English label with _(), and add the needed
translation import near the top of the module so the symbol is available.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 7fc37d7a-a8e9-434f-ad52-213958caf02d

📥 Commits

Reviewing files that changed from the base of the PR and between ec5145d and 98d7dcc.

📒 Files selected for processing (2)
  • sonar/theme/views.py
  • tests/ui/test_views.py

Comment thread sonar/theme/views.py Outdated
Co-Authored-by: Bertrand Zuchuat <bertrand.zuchuat@rero.ch>
@Garfield-fr
Garfield-fr force-pushed the zub-languages-improvement branch from 98d7dcc to 01bcf7e Compare June 29, 2026 09:49
@Garfield-fr
Garfield-fr merged commit 9240402 into rero:staging Jul 22, 2026
4 of 5 checks passed
@Garfield-fr
Garfield-fr deleted the zub-languages-improvement branch July 22, 2026 13:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants