Skip to content

Conversation

@Ravikirana-Microsoft
Copy link
Contributor

@Ravikirana-Microsoft Ravikirana-Microsoft commented Jul 30, 2025

Purpose

This pull request introduces functionality for handling user browser language preferences, improves date formatting based on locale, and removes unnecessary logging from the frontend. Key changes include adding methods to manage browser language, implementing locale-based date formatting, and cleaning up console logs across the frontend codebase.

Backend Changes

User Browser Language Support:

  • Added methods get_user_local_browser_language and set_user_local_browser_language in src/backend/app_config.py to manage user browser language preferences via environment variables.
  • Introduced a new UserLanguage model in src/backend/models/messages_kernel.py to represent user language data.
  • Added an API endpoint /api/user_browser_language in src/backend/app_kernel.py to receive and store the user's browser language.

Locale-based Date Formatting:

  • Implemented the format_dates_in_messages function in src/backend/app_kernel.py to format dates in messages based on the user's locale.
  • Updated the get_plans method in src/backend/app_kernel.py to format dates in messages using the user's browser language.
  • Updated HrTools and ProductTools in src/backend/kernel_tools to dynamically use the user's selected language for date formatting. [1] [2]

Error Handling Improvements:

  • Enhanced error messages for rate limit exceptions in input_task_endpoint to provide clearer feedback to the user. [1] [2]

Dependencies and Testing:

  • Added babel to src/backend/requirements.txt for date and internationalization support.
  • Introduced a test utility src/backend/test_utils_date_fixed.py to validate date formatting functionality.

Frontend Changes

User Browser Language Integration:

  • Added a new API endpoint /user_browser_language to API_ENDPOINTS in src/frontend/src/api/apiService.tsx.
  • Implemented sendUserBrowserLanguage in APIService to send the user's browser language to the backend.
  • Integrated sendUserBrowserLanguage in src/frontend/src/index.tsx during application initialization.

Logging Cleanup:

  • Removed unnecessary console.log statements from various files, including apiClient.tsx, config.tsx, HomeInput.tsx, and PlanPage.tsx, to reduce noise in the logs. [1] [2] [3] [4] [5] [6] [7] [8]

Does this introduce a breaking change?

  • Yes
  • No

How to Test

  • Get the code
git clone [repo-address]
cd [repo-name]
git checkout [branch-name]
npm install
  • Test the code

What to Check

Verify that the following are valid

  • ...

Other Information

@Roopan-Microsoft Roopan-Microsoft merged commit deca2f4 into dev Jul 30, 2025
8 checks passed
@Roopan-Microsoft Roopan-Microsoft deleted the userstory-changes branch July 30, 2025 11:24
blessing-msft pushed a commit that referenced this pull request Aug 1, 2025
fix: User story changes and bug fix
@github-actions
Copy link

🎉 This PR is included in version 2.2.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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