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

made language selection understandable #822

Merged
merged 2 commits into from
Jan 6, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 30 additions & 3 deletions td.vue/src/components/LocaleSelect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
v-for="locale in $i18n.availableLocales"
:key="`locale-${locale}`"
:value="locale"
@click.native="updateLocale(locale)">{{ locale }}</b-dropdown-item>
@click.native="updateLocale(locale)">{{getLanguageName(locale)}}</b-dropdown-item>
</b-dropdown>
</div>
</template>
Expand Down Expand Up @@ -34,7 +34,34 @@ export default {
// tell the electron main process that the locale has changed
window.electronAPI.updateMenu(locale);
}
}
}
},
getLanguageName(locale) {
switch (locale) {
case 'ara':
return 'العربية'; // Arabic
case 'deu':
return 'Deutsch'; // German
case 'ell':
return 'Ελληνικά'; // Greek
case 'eng':
return 'English';
case 'spa':
return 'Español'; // Spanish
case 'fin':
return 'Suomi'; // Finnish
case 'fra':
return 'Français'; // French
case 'hin':
return 'हिंदी'; // Hindi
case 'por':
return 'Português'; // Portuguese
case 'zho':
return '中文'; // Chinese
default:
return locale; // Default to the original locale code if not found
}
}
},

};
</script>