Skip to content

Commit

Permalink
MWPW-128600 Locale Tool: Langstore points to langstore/en (#2615)
Browse files Browse the repository at this point in the history
* MWPW-128600 Langstore points to langstore/en

* Update libs/blocks/locale-nav/locale-nav.js

Co-authored-by: Rares Munteanu <overmyheadandbody@gmail.com>

---------

Co-authored-by: Rares Munteanu <overmyheadandbody@gmail.com>
  • Loading branch information
chrischrischris and overmyheadandbody authored Jul 24, 2024
1 parent 0569bfd commit 543d9a8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion libs/blocks/locale-nav/locale-nav.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,14 @@ const decorateLocales = (current) => {
delete locales[currLocale];
return Object.keys(locales).map((key) => {
const prefix = key === '' ? key : `/${key}`;
const localePath = currLocale === ''
let localePath = currLocale === ''
? `/${key}${current.pathname}`
: current.pathname.replace(current.locale.prefix, prefix);
if (localePath.startsWith('/langstore/')) {
// eslint-disable-next-line no-param-reassign
key = 'langstore/en';
localePath = localePath.replace('/langstore/', `/${key}/`);
}
const li = createTag('li', { class: 'detail' }, `<span>${key || 'us'}</span>`);
getStatus(li, localePath);
return li;
Expand Down

0 comments on commit 543d9a8

Please sign in to comment.