File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
javascripts/discourse/components Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change 11import Component from "@glimmer/component" ;
22import { dasherize } from "@ember/string" ;
33
4+ function normalizeLocale ( locale ) {
5+ return locale ?. toLowerCase ( ) . replace ( / - / g, "_" ) ;
6+ }
47export default class CustomHeaderLinks extends Component {
58 get shouldShow ( ) {
69 return settings . custom_header_links ?. length > 0 ;
@@ -16,7 +19,9 @@ export default class CustomHeaderLinks extends Component {
1619 const locale = link . locale ;
1720 const device = link . view ;
1821
19- if ( ! linkText || ( locale && document . documentElement . lang !== locale ) ) {
22+ const currentLocale = normalizeLocale ( document . documentElement . lang ) ;
23+
24+ if ( ! linkText || ( locale && normalizeLocale ( locale ) !== currentLocale ) ) {
2025 return result ;
2126 }
2227
You can’t perform that action at this time.
0 commit comments