mirror of
https://github.com/discourse/discourse.git
synced 2025-01-31 14:03:02 +08:00
A11Y: allow tab titles to use default translation (#24727)
This commit is contained in:
parent
c4cc738d0a
commit
3a98474983
|
@ -36,12 +36,8 @@ export default class UserMenuTab {
|
||||||
} else {
|
} else {
|
||||||
key = `user_menu.tabs.${id}`;
|
key = `user_menu.tabs.${id}`;
|
||||||
}
|
}
|
||||||
// the lookup method returns undefined if the key doesn't exist.
|
|
||||||
// this ensures that don't use the "missing translation" string as the
|
return I18n.t(key, { count });
|
||||||
// title for tabs that don't define title in the yml files.
|
|
||||||
if (I18n.lookup(key)) {
|
|
||||||
return I18n.t(key, { count });
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue
Block a user