Skip to content
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

Fix issue track filter label not showing correct #213

Merged
merged 1 commit into from
Aug 7, 2024

Conversation

odkhang
Copy link
Collaborator

@odkhang odkhang commented Aug 7, 2024

Instead of showing object, showing track name with correct user language

image

image

Copy link

sourcery-ai bot commented Aug 7, 2024

Reviewer's Guide by Sourcery

This pull request addresses the issue where the track filter label was not showing correctly by updating the template to use a new method getTrackName. This method handles the localization of track names based on the user's language preference stored in localStorage.

File-Level Changes

Files Changes
webapp/src/views/schedule/index.vue Updated the track name display logic to support localization by introducing a new method getTrackName.

Tips
  • Trigger a new Sourcery review by commenting @sourcery-ai review on the pull request.
  • Continue your discussion with Sourcery by replying directly to review comments.
  • You can change your review settings at any time by accessing your dashboard:
    • Enable or disable the Sourcery-generated pull request summary or reviewer's guide;
    • Change the review language;
  • You can always contact us if you have any questions or feedback.

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @odkhang - I've reviewed your changes - here's some feedback:

Overall Comments:

  • Consider abstracting the getTrackName logic into a reusable utility function for handling multilingual content across the application.
  • The use of localStorage.userLanguage might not be the most robust approach for language selection. Consider using a more standardized method or integrating with the app's existing internationalization system.
Here's what I looked at during the review
  • 🟡 General issues: 1 issue found
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.

@@ -93,6 +93,18 @@ export default {
// TODO smooth scroll, seems to not work with chrome {behavior: 'smooth', block: 'center', inline: 'center'}
tabEl?.$el.scrollIntoView()
},
getTrackName(track) {
const language_track = localStorage.userLanguage;
Copy link

Choose a reason for hiding this comment

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

suggestion: Rename language_track to languageTrack for consistency

To maintain consistent camelCase naming convention, consider renaming 'language_track' to 'languageTrack'.

const languageTrack = localStorage.userLanguage;

@mariobehling mariobehling merged commit 695e4e1 into fossasia:development Aug 7, 2024
1 of 2 checks passed
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