Setup Angular 17
Introduction
Dashonic is a fully featured premium admin dashboard template in Angular with Angular CLI with Firebase/fake-backend authentication and developer-friendly codes.
i18n Language translation settings
How to add new language? Let add French language in the existing language.
-
Create fr.json file with reference to default language file and add it to
src/assets/i18n
folder. - Go to language.service.ts file and add i18n language short form "fr" to languages array, and update below lines.
export class LanguageService { public languages: string[] = ['en', 'es', 'de', 'it', 'ru', "fr"]; constructor() { translate.use(browserLang.match(/en|es|de|it|ru|fr/) ? browserLang : 'en'); } }
- Add new language properties in listLang array to
/src/app/layouts/topbar/topbar.component.ts
file
listLang = [ { text: 'English', flag: 'assets/images/flags/us.jpg', lang: 'en' }, { text: 'Spanish', flag: 'assets/images/flags/spain.jpg', lang: 'es' }, { text: 'German', flag: 'assets/images/flags/germany.jpg', lang: 'de' }, { text: 'Italian', flag: 'assets/images/flags/italy.jpg', lang: 'it' }, { text: 'Russian', flag: 'assets/images/flags/russia.jpg', lang: 'ru' }, { text: 'French', flag: 'assets/images/flags/french.jpg', lang: 'fr' }, ];
Prerequisites
Please follow below steps to install and setup all prerequisites:
-
Nodejs
Make sure to have the Node.js installed & running in your computer. If you already have installed Node on your computer, you can skip this step if your existing node version is greater than 18.
-
Git
Make sure to have the Git installed globally & running on your computer. If you already have installed git on your computer, you can skip this step.
Installation
To setup the admin theme, follow below-mentioned steps:
-
Install Prerequisites
Make sure to have all above prerequisites installed & running on your computer
After you finished with the above steps, you can run the following commands into the terminal / command prompt from the root directory of the project to run the project locally or build for production use:
Command | Description |
---|---|
npm install
|
This would install all the required dependencies in the node_modules folder. |
ng serve
|
Runs the project locally, starts the development server and watches for any changes in your code. The development server is accessible at http://localhost:4200. |
ng build
|
Generates a /dist directory with all the development files.
|
ng build --configuration production
|
Generates a /dist directory with all the production files.
|
Tips
SCSS: We suggest you
to do not change any
scss files from the
src/assets/scss/_custom.scss
folders because to
get new updates will
might be break your
SCSS changes if any
you have made. We
strongly suggest you
to use theme.scss
file and use that
instead of overwrite
any theme's custom
scss files.