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: update language dropdown to show complete language title #122

Merged
Show file tree
Hide file tree
Changes from all commits
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
5 changes: 3 additions & 2 deletions components/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ function Logo({ title }: { title: string }) {

function LanguageToggle() {
const { asPath, locales, locale } = useRouter();
const { t } = useTranslation('common');
const [anchorEl, setAnchorEl] = React.useState<null | HTMLElement>(
null,
);
Expand All @@ -87,7 +88,7 @@ function LanguageToggle() {
color: '#fff',
}}
>
{locale}
{t(String(locale))}
</Button>
<Menu
id='language-toggle-menu'
Expand All @@ -114,7 +115,7 @@ function LanguageToggle() {
href={asPath}
locale={localeName}
>
{localeName}
{t(localeName)}
</Link>
</MenuItem>
))}
Expand Down
12 changes: 12 additions & 0 deletions i18n/en/common.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
{
"am": "አማርኛ",
"bn": "বাংলা",
"de": "Deutsch",
"en": "English",
"es": "Español",
"hi": "हिन्दी",
"it": "Italiano",
"ja": "日本語",
"pl": "Polski",
"pt": "Português",
"sw": "Kiswahili",
"vi": "Tiếng Việt",
"shortTitle": "Dev Tools",
"longTitle": "Developer Tools",
"sponsors": "Sponsors",
Expand Down