Skip to content

Commit

Permalink
provides name in the navbar for the locale chosen
Browse files Browse the repository at this point in the history
  • Loading branch information
jgadsden authored Feb 10, 2025
2 parents 4dc9800 + d883ea3 commit 0062b90
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions td.vue/src/components/LocaleSelect.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div class="locale-changer">
<b-dropdown right :text="locale" variant="primary">
<b-dropdown right :text="getLanguageName(locale)" variant="primary">
<div class="px-2 py-2">
<input type="text" v-model="searchQuery" class="form-control" placeholder="Search language..." @click.stop
@input="filterLocales" />
Expand Down Expand Up @@ -29,6 +29,7 @@ export default {
};
},
created() {
// Initialize filteredLocales with all available locales
this.filteredLocales = [...this.$i18n.availableLocales];
},
computed: {
Expand Down Expand Up @@ -101,7 +102,7 @@ export default {
case 'hin':
return 'हिंदी'; // Hindi
case 'id':
return 'Bahasa Indonesia'; // Indonesia
return 'Bahasa Indonesia'; // Indonesia
case 'jpn':
return '日本語'; // Japanese
case 'ms':
Expand Down
2 changes: 1 addition & 1 deletion td.vue/tests/unit/components/localeSelect.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ describe('components/LocaleSelect.vue', () => {
});

it('displays the current locale', () => {
expect(wrapper.findComponent(BDropdown).attributes('text')).toEqual('eng');
expect(wrapper.findComponent(BDropdown).attributes('text')).toEqual('English');
});

it('has an option for eng', () => {
Expand Down

0 comments on commit 0062b90

Please sign in to comment.