Skip to content

Commit

Permalink
Update to Angular 18
Browse files Browse the repository at this point in the history
  • Loading branch information
CodeAndWeb committed Sep 2, 2024
1 parent 7722f08 commit cf7b296
Show file tree
Hide file tree
Showing 115 changed files with 39,240 additions and 16,919 deletions.
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,21 @@
<img alt="Tutorial Image" src="./tutorial.png"/>
</a>

Simple demo project for Anguar and ngx-translate
Simple 3 demo projects for Anguar and ngx-translate.

- **ngx-translate-demo-standalone** - uses standalone components
- **ngx-translate-demo-standalone** - uses standalone modules and the ngx-translate-messageformat-compiler plugin to use ICU formatted translation messages
- **ngx-translate-demo-ngmodules** - uses ngModules (app.module.ts)

Read the tutorial [How to translate your Angular app with ngx-translate](https://www.codeandweb.com/babeledit/tutorials/how-to-translate-your-angular-app-with-ngx-translate) for more information about how to use ngx-translate, ngx-translate-extract and BabelEdit.

The repository also contains demo projects working with Angular 8-13.
The repository also contains demo projects working with Angular 18.

The demo is also available for older Angular versions from 5-17: Please check the branches.

Older versions using Angular 5-7 are available in the branches.
Tutorials for the older version of Angular:

* [How to translate your Angular 8-16 app with ngx-translate](http://localhost:8000/babeledit/tutorials/how-to-translate-your-angular8-16-app-with-ngx-translate)
* [How to translate your Angular 7 app with ngx-translate](https://www.codeandweb.cawwork/babeledit/tutorials/how-to-translate-your-angular7-app-with-ngx-translate)
* [How to translate your Angular 5/6 app with ngx-translate](https://www.codeandweb.cawwork/babeledit/tutorials/how-to-translate-your-angular6-app-with-ngx-translate)

File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# See http://help.github.com/ignore-files/ for more about ignoring files.
# See https://docs.github.com/get-started/getting-started-with-git/ignoring-files for more about ignoring files.

# Compiled output
/dist
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# NgxTranslateDemo
# TranslationDemo

This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 13.3.2.
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 18.2.1.

## Development server

Expand All @@ -24,4 +24,4 @@ Run `ng e2e` to execute the end-to-end tests via a platform of your choice. To u

## Further help

To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page.
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.dev/tools/cli) page.
124 changes: 124 additions & 0 deletions ngx-translate-demo-ngmodules/angular.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"translation-demo": {
"projectType": "application",
"schematics": {
"@schematics/angular:component": {
"style": "scss",
"standalone": false
},
"@schematics/angular:directive": {
"standalone": false
},
"@schematics/angular:pipe": {
"standalone": false
}
},
"root": "",
"sourceRoot": "src",
"prefix": "app",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:application",
"options": {
"outputPath": "dist/translation-demo",
"index": "src/index.html",
"browser": "src/main.ts",
"polyfills": [
"zone.js"
],
"tsConfig": "tsconfig.app.json",
"inlineStyleLanguage": "scss",
"assets": [
{
"glob": "**/*",
"input": "public"
}
],
"styles": [
"src/styles.scss"
],
"scripts": []
},
"configurations": {
"production": {
"budgets": [
{
"type": "initial",
"maximumWarning": "500kB",
"maximumError": "1MB"
},
{
"type": "anyComponentStyle",
"maximumWarning": "2kB",
"maximumError": "4kB"
}
],
"outputHashing": "all"
},
"development": {
"optimization": false,
"extractLicenses": false,
"sourceMap": true
}
},
"defaultConfiguration": "production"
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"configurations": {
"production": {
"buildTarget": "translation-demo:build:production"
},
"development": {
"buildTarget": "translation-demo:build:development"
}
},
"defaultConfiguration": "development"
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n"
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"polyfills": [
"zone.js",
"zone.js/testing"
],
"tsConfig": "tsconfig.spec.json",
"inlineStyleLanguage": "scss",
"assets": [
{
"glob": "**/*",
"input": "public"
}
],
"styles": [
"src/styles.scss"
],
"scripts": [],
"karmaConfig": "karma.conf.js"
}
},
"lint": {
"builder": "@angular-eslint/builder:lint",
"options": {
"lintFilePatterns": [
"src/**/*.ts",
"src/**/*.html"
]
}
}
}
}
},
"cli": {
"schematicCollections": [
"@angular-eslint/schematics"
]
}
}
43 changes: 43 additions & 0 deletions ngx-translate-demo-ngmodules/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
// @ts-check
const eslint = require("@eslint/js");
const tseslint = require("typescript-eslint");
const angular = require("angular-eslint");

module.exports = tseslint.config(
{
files: ["**/*.ts"],
extends: [
eslint.configs.recommended,
...tseslint.configs.recommended,
...tseslint.configs.stylistic,
...angular.configs.tsRecommended,
],
processor: angular.processInlineTemplates,
rules: {
"@angular-eslint/directive-selector": [
"error",
{
type: "attribute",
prefix: "app",
style: "camelCase",
},
],
"@angular-eslint/component-selector": [
"error",
{
type: "element",
prefix: "app",
style: "kebab-case",
},
],
},
},
{
files: ["**/*.html"],
extends: [
...angular.configs.templateRecommended,
...angular.configs.templateAccessibility,
],
rules: {},
}
);
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,21 @@ module.exports = function (config) {
suppressAll: true // removes the duplicated traces
},
coverageReporter: {
dir: require('path').join(__dirname, './coverage/ngx-translate-demo'),
dir: require('path').join(__dirname, './coverage/translation-demo-standalone'),
subdir: '.',
reporters: [
{ type: 'html' },
{ type: 'text-summary' }
]
},
reporters: ['progress', 'kjhtml'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['Chrome'],
singleRun: false,
browsers: ['MyChromeWithoutSearchSelect'],
customLaunchers: {
MyChromeWithoutSearchSelect: {
base: "Chrome",
flags: ["-disable-search-engine-choice-screen"],
},
},
restartOnFileChange: true
});
};
Loading

0 comments on commit cf7b296

Please sign in to comment.