@@ -44,7 +44,7 @@ export default {
methods: {
getIndexUrl(menuItem) {
const locale = language.locales.find(
- (locale) => locale.code === menuItem.lang
+ (locale) => locale.code === menuItem.localeCode
)
return getAbsoluteUrlIfSwitchWebsite({
relativeTarget: `/${locale.code}`,
diff --git a/config/language/pix-pro.js b/config/language/pix-pro.js
index 7a12a74d4..9ec57fe14 100644
--- a/config/language/pix-pro.js
+++ b/config/language/pix-pro.js
@@ -26,13 +26,13 @@ export const language = {
children: [
{
name: 'french',
- lang: 'fr',
+ localeCode: 'fr',
icon: 'icon',
subtitle: null,
},
{
name: 'english',
- lang: 'en-gb',
+ localeCode: 'en-gb',
icon: 'icon',
subtitle: null,
},
@@ -40,7 +40,7 @@ export const language = {
},
{
name: 'france',
- lang: 'fr-fr',
+ localeCode: 'fr-fr',
icon: 'flag-fr.svg',
subtitle: null,
},
diff --git a/config/language/pix-site.js b/config/language/pix-site.js
index 300e9fa41..d66fc08e5 100644
--- a/config/language/pix-site.js
+++ b/config/language/pix-site.js
@@ -40,13 +40,13 @@ export const language = {
children: [
{
name: 'french',
- lang: 'fr',
+ localeCode: 'fr',
icon: 'icon',
subtitle: null,
},
{
name: 'english',
- lang: 'en-gb',
+ localeCode: 'en-gb',
icon: 'icon',
subtitle: null,
},
@@ -54,13 +54,13 @@ export const language = {
},
{
name: 'france',
- lang: 'fr-fr',
+ localeCode: 'fr-fr',
icon: 'flag-fr.svg',
subtitle: null,
},
{
name: 'fwb-acronym',
- lang: 'fr-be',
+ localeCode: 'fr-be',
icon: 'flag-be.svg',
subtitle: 'fwb',
},
diff --git a/tests/config/language/pix-pro.test.js b/tests/config/language/pix-pro.test.js
index 046522ab8..354b68b73 100644
--- a/tests/config/language/pix-pro.test.js
+++ b/tests/config/language/pix-pro.test.js
@@ -60,13 +60,13 @@ describe('#language', () => {
children: [
{
name: 'french',
- lang: 'fr',
+ localeCode: 'fr',
icon: 'icon',
subtitle: null,
},
{
name: 'english',
- lang: 'en-gb',
+ localeCode: 'en-gb',
icon: 'icon',
subtitle: null,
},
@@ -74,7 +74,7 @@ describe('#language', () => {
},
{
name: 'france',
- lang: 'fr-fr',
+ localeCode: 'fr-fr',
icon: 'flag-fr.svg',
subtitle: null,
},
diff --git a/tests/config/language/pix-site.test.js b/tests/config/language/pix-site.test.js
index 6ff1eaaa5..9eb5ffde5 100644
--- a/tests/config/language/pix-site.test.js
+++ b/tests/config/language/pix-site.test.js
@@ -59,13 +59,13 @@ describe('#language', () => {
children: [
{
name: 'french',
- lang: 'fr',
+ localeCode: 'fr',
icon: 'icon',
subtitle: null,
},
{
name: 'english',
- lang: 'en-gb',
+ localeCode: 'en-gb',
icon: 'icon',
subtitle: null,
},
@@ -73,13 +73,13 @@ describe('#language', () => {
},
{
name: 'france',
- lang: 'fr-fr',
+ localeCode: 'fr-fr',
icon: 'flag-fr.svg',
subtitle: null,
},
{
name: 'fwb-acronym',
- lang: 'fr-be',
+ localeCode: 'fr-be',
icon: 'flag-be.svg',
subtitle: 'fwb',
},
From 672c5075d6119db517c9b2727b1195164e8a0d49 Mon Sep 17 00:00:00 2001
From: Yann Bertrand <5855339+yannbertrand@users.noreply.github.com>
Date: Mon, 9 Jan 2023 16:32:02 +0100
Subject: [PATCH 2/6] sr: rename language-switcher component as locale-switcher
---
components/BurgerMenuNav.vue | 2 +-
.../LocaleSwitcher.vue} | 64 +++++++-------
.../LocaleSwitcherSubMenu.vue} | 8 +-
components/slices/ActionsZone.vue | 2 +-
lang/en-gb.js | 2 +-
lang/fr-be.js | 2 +-
lang/fr-fr.js | 2 +-
lang/fr.js | 2 +-
tests/components/BurgerMenuNav.test.js | 6 +-
...witcher.test.js => LocaleSwitcher.test.js} | 36 ++++----
...st.js.snap => LocaleSwitcher.test.js.snap} | 84 +++++++++----------
tests/components/slices/ActionsZone.test.js | 6 +-
12 files changed, 108 insertions(+), 108 deletions(-)
rename components/{LanguageSwitcher/LanguageSwitcher.vue => LocaleSwitcher/LocaleSwitcher.vue} (84%)
rename components/{LanguageSwitcher/LanguageSwitcherSubMenu.vue => LocaleSwitcher/LocaleSwitcherSubMenu.vue} (84%)
rename tests/components/{LanguageSwitcher.test.js => LocaleSwitcher.test.js} (56%)
rename tests/components/__snapshots__/{LanguageSwitcher.test.js.snap => LocaleSwitcher.test.js.snap} (65%)
diff --git a/components/BurgerMenuNav.vue b/components/BurgerMenuNav.vue
index 8962c62ef..c1d4e1e99 100644
--- a/components/BurgerMenuNav.vue
+++ b/components/BurgerMenuNav.vue
@@ -2,7 +2,7 @@
diff --git a/components/LanguageSwitcher/LanguageSwitcher.vue b/components/LocaleSwitcher/LocaleSwitcher.vue
similarity index 84%
rename from components/LanguageSwitcher/LanguageSwitcher.vue
rename to components/LocaleSwitcher/LocaleSwitcher.vue
index 65a8dbefd..1d3e52621 100644
--- a/components/LanguageSwitcher/LanguageSwitcher.vue
+++ b/components/LocaleSwitcher/LocaleSwitcher.vue
@@ -1,12 +1,12 @@
-
+
-