Skip to content

Commit

Permalink
support mutiple language for filter track (#217)
Browse files Browse the repository at this point in the history
  • Loading branch information
odkhang authored Aug 12, 2024
1 parent 24c0f7e commit a33ab54
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion webapp/src/views/schedule/sessions/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
h1 {{ $t('Tracks')}}
template(v-for="track in schedule.tracks")
div.item(v-if="track")
bunt-checkbox(v-model="tracksFilter[track.id]",name="track_room_views") {{track.name}}
bunt-checkbox(v-model="tracksFilter[track.id]",name="track_room_views") {{ getTrackName(track) }}
</template>
<script>
import { mapState, mapGetters } from 'vuex'
Expand Down Expand Up @@ -131,6 +131,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;
if (typeof track.name === 'object' && track.name !== null) {
if (language_track && track.name[language_track]) {
return track.name[language_track];
} else {
return track.name.en || track.name;
}
} else {
return track.name;
}
},
toggleFavFilter () {
this.tracksFilter = {}
if (this.filter.type === 'fav') {
Expand Down Expand Up @@ -242,3 +254,4 @@ export default {
margin-right: 10px
</style>

0 comments on commit a33ab54

Please sign in to comment.