Skip to content

Commit

Permalink
Merge pull request developertools-tech#122 from burhanharoon/update-l…
Browse files Browse the repository at this point in the history
…anguage-dropdown-translation

fix: update language dropdown to show complete language title
  • Loading branch information
dlford authored Oct 18, 2023
2 parents 60e0942 + da9cfd6 commit fed0eee
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
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

0 comments on commit fed0eee

Please sign in to comment.