From 2f967d77c4a41a32af708e73ce63db65a53eef91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=83=A1=E6=B8=85=E9=98=B3?= Date: Sun, 11 Mar 2018 20:24:03 +0800 Subject: [PATCH 1/4] Bug: small fixes --- config/packages/translation.yaml | 3 +-- package.json | 7 +------ src/Controller/Basic/AboutController.php | 8 -------- src/Listener/LocaleListener.php | 4 ++-- web/components/School/Blackboard.vue | 23 ++++++++++++++++------- 5 files changed, 20 insertions(+), 25 deletions(-) diff --git a/config/packages/translation.yaml b/config/packages/translation.yaml index bc81d25..0202cf0 100644 --- a/config/packages/translation.yaml +++ b/config/packages/translation.yaml @@ -3,5 +3,4 @@ framework: translator: paths: - '%kernel.project_dir%/web/translation/backend' - fallbacks: - - 'zh' + fallbacks: ['zh'] diff --git a/package.json b/package.json index 5e1c65d..df7ad11 100644 --- a/package.json +++ b/package.json @@ -68,7 +68,6 @@ "babel-preset-stage-2": "^6.22.0", "chalk": "^2.0.1", "copy-webpack-plugin": "^4.0.1", - "css-loader": "^0.28.0", "eslint": "^4.15.0", "eslint-config-standard": "^10.2.1", "eslint-friendly-formatter": "^3.0.0", @@ -85,7 +84,6 @@ "node-notifier": "^5.1.2", "node-sass": "^4.7.2", "optimize-css-assets-webpack-plugin": "^3.2.0", - "ora": "^1.2.0", "portfinder": "^1.0.13", "postcss-import": "^11.0.0", "postcss-loader": "^2.0.8", @@ -94,17 +92,14 @@ "sass-loader": "^6.0.6", "semver": "^5.3.0", "shelljs": "^0.7.6", - "style-loader": "^0.19.1", "uglifyjs-webpack-plugin": "^1.1.1", "url-loader": "^0.5.8", "vue-lazyload": "^1.2.1", "vue-loader": "^13.3.0", - "vue-style-loader": "^3.0.1", "vue-template-compiler": "^2.5.2", "webpack": "^3.6.0", "webpack-bundle-analyzer": "^2.9.0", - "webpack-dev-server": "^2.9.1", - "webpack-merge": "^4.1.0" + "webpack-dev-server": "^2.9.1" }, "engines": { "node": ">= 6.0.0", diff --git a/src/Controller/Basic/AboutController.php b/src/Controller/Basic/AboutController.php index 10a9f86..1ec1e16 100644 --- a/src/Controller/Basic/AboutController.php +++ b/src/Controller/Basic/AboutController.php @@ -32,12 +32,4 @@ public function version() return $this->response()->response($gitHashLong); } - /** - * @Route("/about/trans") - */ - public function trans(TranslatorInterface $translator) { - //$a = ; - return $this->response()->response($translator->trans("nihao")); - - } } diff --git a/src/Listener/LocaleListener.php b/src/Listener/LocaleListener.php index 427237a..ba7f161 100644 --- a/src/Listener/LocaleListener.php +++ b/src/Listener/LocaleListener.php @@ -7,9 +7,9 @@ class LocaleListener { public function onKernelRequest(GetResponseEvent $event) { $request = $event->getRequest(); - if($request->cookies->get("locale") === "zh") + if($request->cookies->get("lang") === "zh") $request->setLocale("zh"); - else if ($request->cookies->get("locale") === "en") + else if ($request->cookies->get("lang") === "en") $request->setLocale("en"); else if(strpos($request->headers->get("Accept-Language"),"zh") === false) $request->setLocale("en"); diff --git a/web/components/School/Blackboard.vue b/web/components/School/Blackboard.vue index d89b8c2..91ffba2 100644 --- a/web/components/School/Blackboard.vue +++ b/web/components/School/Blackboard.vue @@ -1,6 +1,6 @@