<select class="form-control" #selectedLang (change)="switchLanguage(selectedLang.value)">
<option *ngFor="let language of translate.getLangs()" [value]="language"
[selected]="language === translate.currentLang">
{{ language }}
</option>
</select>| "scripts": { | |
| "pre-commit": "chmod +x .git/hooks/pre-commit" | |
| } |
| chmod +x .git/hooks/pre-commit |
| #!/bin/sh | |
| # Gets the name of the current branch | |
| current_branch=$(git symbolic-ref --short HEAD) | |
| # Checks if the current branch is the main branch | |
| if [ "$current_branch" = "main" ]; then | |
| echo "Pushes to the main branch are not allowed." | |
| exit 1 | |
| else |
There are many ways to install bootstrap in Angular.
You can do it with CDN or with a module package like Npm or Yarn.
However, there are different packages and ways to do it.
Also each way has its own configuration.
Therefore, I have decided that the best way to install it in a new project is using the npm ng-bootstrap library.
I have decided to create this Gist to explain how I have done the installation and configuration of the translation module. I do it as an update of the original post since I have found errors due to the fact that it is from 2020. To do so, I will simply describe how I have done it from the previous tutorial.
Original post from 2020: https://www.alphabold.com/how-to-implement-multilanguage-support-in-an-angular-application/
- CREATE AN ANGULAR APPLICATION Let us create an angular application for this implementation. Make sure you have npm install in the project directory, if not run ‘npm install’ in the project directory. After you have installed npm, let’s create a new angular application using ‘ng new . Once created cd