From 1b196c32b7b1722b9b18ded1a35dee5282ea41f5 Mon Sep 17 00:00:00 2001 From: juanmesa2097 Date: Tue, 27 Apr 2021 20:45:56 -0500 Subject: [PATCH 1/6] chore(i18n): remove internationalization support (#303) --- README.md | 27 +++++------ angular.json | 46 +++---------------- package.json | 10 ++-- .../components/footer/footer.component.html | 1 - .../components/header/header.component.html | 1 - src/app/pages/+home/home.page.html | 4 +- 6 files changed, 22 insertions(+), 67 deletions(-) diff --git a/README.md b/README.md index 9384f14af..40147d428 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,6 @@ - Unit tests with Jest instead of Karma & Jasmine. - e2e tests with Cypress instead of Protractor. - PWA -- i18n - Dynamic titles and content meta tags. - TailwindCSS + Autoprefixer + PurgeCSS setup. - Dark mode and theme configuration. @@ -288,18 +287,14 @@ yarn remove tailwindcss autoprefixer postcss ## πŸ§™β€β™‚οΈ Commands -| Command | Description | NPM | Yarn | Background command | -| ------------- | ------------------------------------------------- | --------------------- | ------------------ | --------------------------------------------------------------- | -| ng | See available commands | npm run ng | yarn ng | ng | -| dev | Run your app in development mode & open app | npm run dev | yarn dev | ng serve -o | -| start | Run your app in development mode | npm start | yarn start | ng serve | -| start:es | Run your app in development mode in spanish | npm run start:es | yarn start:es | ng serve -c=es --port 4201 | -| build | Build your app | npm run build | yarn build | ng build | -| build:prod | Build your app ready for production | npm run build:prod | yarn build:prod | ng build --prod --build-optimizer --aot --stats-json | -| build:i18n | Build your multilingual app ready for production | npm run build:i18n | yarn build:i18n | ng build --prod --build-optimizer --aot --stats-json --localize | -| test | Run your unit tests | npm run test | yarn test | ng test | -| test:coverage | Run your unit tests & generates a coverage report | npm run test:coverage | yarn test:coverage | ng test --coverage | -| lint | Use ESLint to lint your app | npm run lint | yarn lint | ng lint | -| e2e | Run your e2e tests | npm run e2e | yarn e2e | ng e2e | -| i18n:extract | Extract i18n messages from i18n directives | npm run extract | yarn extract | ng extract-i18n --output-path locale --ivy | -| analyze | Open webpack-bundle-analyzer | npm run analyze | yarn analyze | webpack-bundle-analyzer dist/angular-boilerplate/stats.json | +| Command | Description | NPM | Yarn | Background command | +| ------------- | ------------------------------------------------- | --------------------- | ------------------ | ----------------------------------------------------------- | +| ng | See available commands | npm run ng | yarn ng | ng | +| start | Run your app in development mode | npm start | yarn start | ng serve | +| build | Build your app | npm run build | yarn build | ng build | +| build:prod | Build your app ready for production | npm run build:prod | yarn build:prod | ng build --prod --build-optimizer --aot --stats-json | +| test:unit | Run your unit tests | npm run test | yarn test | ng test | +| test:e2e | Run your e2e tests | npm run e2e | yarn e2e | ng e2e | +| test:coverage | Run your unit tests & generates a coverage report | npm run test:coverage | yarn test:coverage | ng test --coverage | +| lint | Use ESLint to lint your app | npm run lint | yarn lint | ng lint | +| analyze | Open webpack-bundle-analyzer | npm run analyze | yarn analyze | webpack-bundle-analyzer dist/angular-boilerplate/stats.json | diff --git a/angular.json b/angular.json index f1e30244b..7c5ad587f 100644 --- a/angular.json +++ b/angular.json @@ -29,14 +29,8 @@ "polyfills": "src/polyfills.ts", "tsConfig": "tsconfig.app.json", "aot": true, - "assets": [ - "src/favicon.ico", - "src/assets", - "src/public" - ], - "styles": [ - "src/theme/styles.scss" - ], + "assets": ["src/favicon.ico", "src/assets", "src/public"], + "styles": ["src/theme/styles.scss"], "scripts": [] }, "configurations": { @@ -68,11 +62,6 @@ ], "serviceWorker": true, "ngswConfigPath": "ngsw-config.json" - }, - "es": { - "localize": [ - "es" - ] } } }, @@ -84,40 +73,23 @@ "configurations": { "production": { "browserTarget": "angular-boilerplate:build:production" - }, - "es": { - "browserTarget": "angular-boilerplate:build:es" } } }, - "extract-i18n": { - "builder": "@angular-devkit/build-angular:extract-i18n", - "options": { - "browserTarget": "angular-boilerplate:build" - } - }, "test": { "builder": "@angular-builders/jest:run", "options": { "polyfills": "src/polyfills.ts", "tsConfig": "tsconfig.spec.json", - "assets": [ - "src/public/favicon.ico", - "src/assets" - ], - "styles": [ - "src/theme/styles.scss" - ], + "assets": ["src/public/favicon.ico", "src/assets"], + "styles": ["src/theme/styles.scss"], "scripts": [] } }, "lint": { "builder": "@angular-eslint/builder:lint", "options": { - "lintFilePatterns": [ - "src/**/*.ts", - "src/**/*.html" - ] + "lintFilePatterns": ["src/**/*.ts", "src/**/*.html"] } }, "e2e": { @@ -157,14 +129,8 @@ } } } - }, - "i18n": { - "sourceLocale": "en-US", - "locales": { - "es": "locale/messages.es.xlf" - } } } }, "defaultProject": "angular-boilerplate" -} \ No newline at end of file +} diff --git a/package.json b/package.json index 96eaccec4..00d22789f 100644 --- a/package.json +++ b/package.json @@ -5,17 +5,13 @@ "private": true, "scripts": { "ng": "ng", - "dev": "ng serve -o", "start": "ng serve", - "start:es": "ng serve -c=es --port 4201", "build": "ng build", "build:prod": "set NODE_ENV=production&& ng build --prod --build-optimizer --aot --stats-json", - "build:i18n": "set NODE_ENV=production&& ng build --prod --build-optimizer --aot --stats-json --localize", - "test": "ng test", + "test:unit": "ng test", + "test:e2e": "ng e2e", "test:coverage": "ng test --coverage", "lint": "ng lint", - "e2e": "ng e2e", - "i18n:extract": "ng extract-i18n --output-path locale --ivy", "analyze": "webpack-bundle-analyzer dist/angular-boilerplate/stats.json" }, "dependencies": { @@ -48,7 +44,7 @@ "@cypress/webpack-preprocessor": "5.7.0", "@types/jasmine": "~3.6.9", "@types/jest": "26.0.23", - "@types/node": "^14.14.39", + "@types/node": "^14.14.39", "@typescript-eslint/eslint-plugin": "4.22.0", "@typescript-eslint/parser": "4.22.0", "autoprefixer": "^10.2.5", diff --git a/src/app/components/footer/footer.component.html b/src/app/components/footer/footer.component.html index 1adbf1656..760ba1a16 100644 --- a/src/app/components/footer/footer.component.html +++ b/src/app/components/footer/footer.component.html @@ -1,5 +1,4 @@