diff --git a/package-lock.json b/package-lock.json index c374fad..7bc1fc0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19,6 +19,7 @@ "three": "^0.168.0", "uniqid": "^5.4.0", "vue": "^3.5.6", + "vue-i18n": "^11.2.8", "vue-router": "^4.4.5" }, "devDependencies": { @@ -542,6 +543,50 @@ "@swc/helpers": "^0.5.0" } }, + "node_modules/@intlify/core-base": { + "version": "11.2.8", + "resolved": "https://registry.npmjs.org/@intlify/core-base/-/core-base-11.2.8.tgz", + "integrity": "sha512-nBq6Y1tVkjIUsLsdOjDSJj4AsjvD0UG3zsg9Fyc+OivwlA/oMHSKooUy9tpKj0HqZ+NWFifweHavdljlBLTwdA==", + "license": "MIT", + "dependencies": { + "@intlify/message-compiler": "11.2.8", + "@intlify/shared": "11.2.8" + }, + "engines": { + "node": ">= 16" + }, + "funding": { + "url": "https://github.com/sponsors/kazupon" + } + }, + "node_modules/@intlify/message-compiler": { + "version": "11.2.8", + "resolved": "https://registry.npmjs.org/@intlify/message-compiler/-/message-compiler-11.2.8.tgz", + "integrity": "sha512-A5n33doOjmHsBtCN421386cG1tWp5rpOjOYPNsnpjIJbQ4POF0QY2ezhZR9kr0boKwaHjbOifvyQvHj2UTrDFQ==", + "license": "MIT", + "dependencies": { + "@intlify/shared": "11.2.8", + "source-map-js": "^1.0.2" + }, + "engines": { + "node": ">= 16" + }, + "funding": { + "url": "https://github.com/sponsors/kazupon" + } + }, + "node_modules/@intlify/shared": { + "version": "11.2.8", + "resolved": "https://registry.npmjs.org/@intlify/shared/-/shared-11.2.8.tgz", + "integrity": "sha512-l6e4NZyUgv8VyXXH4DbuucFOBmxLF56C/mqh2tvApbzl2Hrhi1aTDcuv5TKdxzfHYmpO3UB0Cz04fgDT9vszfw==", + "license": "MIT", + "engines": { + "node": ">= 16" + }, + "funding": { + "url": "https://github.com/sponsors/kazupon" + } + }, "node_modules/@jridgewell/sourcemap-codec": { "version": "1.5.5", "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz", @@ -1857,6 +1902,26 @@ } } }, + "node_modules/vue-i18n": { + "version": "11.2.8", + "resolved": "https://registry.npmjs.org/vue-i18n/-/vue-i18n-11.2.8.tgz", + "integrity": "sha512-vJ123v/PXCZntd6Qj5Jumy7UBmIuE92VrtdX+AXr+1WzdBHojiBxnAxdfctUFL+/JIN+VQH4BhsfTtiGsvVObg==", + "license": "MIT", + "dependencies": { + "@intlify/core-base": "11.2.8", + "@intlify/shared": "11.2.8", + "@vue/devtools-api": "^6.5.0" + }, + "engines": { + "node": ">= 16" + }, + "funding": { + "url": "https://github.com/sponsors/kazupon" + }, + "peerDependencies": { + "vue": "^3.0.0" + } + }, "node_modules/vue-router": { "version": "4.5.1", "resolved": "https://registry.npmjs.org/vue-router/-/vue-router-4.5.1.tgz", diff --git a/package.json b/package.json index db18c29..8f71718 100644 --- a/package.json +++ b/package.json @@ -21,6 +21,7 @@ "three": "^0.168.0", "uniqid": "^5.4.0", "vue": "^3.5.6", + "vue-i18n": "^11.2.8", "vue-router": "^4.4.5" }, "devDependencies": { diff --git a/public/site/config/config.php b/public/site/config/config.php index 779ca22..4ac5104 100644 --- a/public/site/config/config.php +++ b/public/site/config/config.php @@ -28,6 +28,7 @@ return [ 'install' => 'true' ], 'routes' => [ + require(__DIR__ . '/routes/en-locale.php'), require(__DIR__ . '/routes/logout.php'), require(__DIR__ . '/routes/login.php'), require(__DIR__ . '/routes/toggle-favorite.php'), diff --git a/public/site/config/routes/en-locale.php b/public/site/config/routes/en-locale.php new file mode 100644 index 0000000..9391ad1 --- /dev/null +++ b/public/site/config/routes/en-locale.php @@ -0,0 +1,44 @@ + 'en/(:all?)', + 'action' => function ($uri = '') { + // Si l'URI se termine par .json, chercher la page et retourner le JSON + if (str_ends_with($uri, '.json')) { + $uri = str_replace('.json', '', $uri); + $page = page($uri); + + if (!$page) { + // Si pas de page trouvée, essayer avec 'home' + if ($uri === '' || $uri === '/') { + $page = page('home'); + } else { + return false; // 404 + } + } + + // Retourner la page pour que Kirby serve le template .json.php + return $page; + } + + // Pour les URLs normales (sans .json), chercher la page + $page = page($uri); + + if (!$page) { + // Si pas de page trouvée, essayer avec 'home' + if ($uri === '' || $uri === '/') { + $page = page('home'); + } else { + return false; // 404 + } + } + + // Retourner la page pour que Kirby serve le template .php + return $page; + } +]; diff --git a/public/site/controllers/site.php b/public/site/controllers/site.php index ae5d333..27524bd 100644 --- a/public/site/controllers/site.php +++ b/public/site/controllers/site.php @@ -32,7 +32,7 @@ return function ($page, $kirby, $site) { return [ "title" => (string) $project->title(), "uri" => (string) $project->uri(), - "step" => (string) $project->getStepLabel(), + "step" => (string) $project->currentStep(), "uuid" => (string) $project->uuid(), ]; })->data; diff --git a/public/site/models/project.php b/public/site/models/project.php index de53a50..15f663e 100644 --- a/public/site/models/project.php +++ b/public/site/models/project.php @@ -99,7 +99,6 @@ class ProjectPage extends NotificationsPage { } return [ - 'label' => $child->title()->value(), 'id' => $child->stepName()->value(), 'slug' => $child->slug(), 'index' => intval($child->stepIndex()->value()), @@ -217,18 +216,6 @@ class ProjectPage extends NotificationsPage { } } - public function getStepLabel() { - $stepsLabel = [ - "clientBrief" => "brief", - "proposal" => "offre commerciale", - "extendedBrief" => "brief enrichi", - "industrialIdeation" => "idéation industrielle", - "virtualSample" => "échantillon virtuel", - "physicalSample" => "échantillon physique", - ]; - - return $stepsLabel[$this->currentStep()->value()]; - } // public function printManagers() { // return A::implode($this->managers()->toUsers()->pluck('name'), ', '); diff --git a/public/site/plugins/helpers/index.php b/public/site/plugins/helpers/index.php index 3ab39f6..cdb3acc 100644 --- a/public/site/plugins/helpers/index.php +++ b/public/site/plugins/helpers/index.php @@ -94,7 +94,6 @@ function processDTLProposals($page) { ], "path" => "/projects/" . $page->slug() . "?dialog=proposal&fileIndex=" . $index, "date" => $proposalFile->modified("d/MM/Y"), - "stepLabel" => "Proposition commerciale", ]; } break; @@ -112,7 +111,6 @@ function processDTLProposals($page) { ], "path" => "/projects/" . $page->slug() . "?dialog=industrial-ideation", "date" => $proposalFile->modified("d/MM/Y"), - "stepLabel" => "Idéation industrielle", ]; } break; @@ -129,7 +127,6 @@ function processDTLProposals($page) { ], "path" => "/projects/" . $page->slug() . "?dialog=virtual-sample", "date" => $proposalPage->modified("d/MM/Y"), - "stepLabel" => "Échantillon virtuel - piste dynamique", ]; } break; @@ -147,7 +144,6 @@ function processDTLProposals($page) { ], "path" => "/projects/" . $page->slug() . "?dialog=virtual-sample", "date" => $proposalFile->modified("d/MM/Y"), - "stepLabel" => "Échantillon virtuel - piste statique", ]; } break; diff --git a/src/assets/css/src/2.blocks.comments.css b/src/assets/css/src/2.blocks.comments.css index 4d2ac12..450e09b 100644 --- a/src/assets/css/src/2.blocks.comments.css +++ b/src/assets/css/src/2.blocks.comments.css @@ -20,7 +20,7 @@ } .comments.empty::after { - content: "Partagez vos idées en ajoutant des commentaires"; + content: attr(data-empty-message); height: 100%; display: grid; place-items: center; diff --git a/src/components/Menu.vue b/src/components/Menu.vue index 65aa5a3..066af07 100644 --- a/src/components/Menu.vue +++ b/src/components/Menu.vue @@ -29,7 +29,22 @@